mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-3299] and [ADF-3300] upgrade to Angular and Material 6 (#3579)
* upgrade to HttpClient * upgrade to Renderer2 * upgrade Document reference * remove useless test with deprecated ReflectiveInjector * upgrade to latest typescript * upgrade libs * upgrade package scripts * remove rxjs blacklists and duplicate rules * add rxjs compat to help with migration * fix breaking changes * fix breaking changes in material * fix breaking changes (material 6) * upgrade rxjs, ngx-translate and flex layout * update unit tests * restore providers * upgrade deprecated Observable.error * rebase fix first configuration problems * fix style issues commented * fix core build * fix lib template errors * move lib test execution in angular.json * ignore * karma conf files * fix import statement test * single run option * update packages reporter * restore report * increase timeout * improve karma conf test configuration * fix test issues about lint * fix test analytics * fix process service test * content service fix test * fix logout directive test * fix core test * fix build * update node-sass to latest * update angular cli dependencies * improve build script create directorites and move files only if previous command succeded * upgrade individual libs to 6.0 * remove old webpack files * revert sass change * fix type issues fix style issues * fix tslint demo shell issue * fix peerdependencies * fix test e2e BC * package upate * fix style import issue * extract-text-webpack-plugin beta * fix test dist build command * remove alpha js-api * fix tslint issue add banner tslint rule * upload service fix * change BC script * fix test dist script * increase demo shell timeout test * verbose copy * path absolute * fix script bc * fix copy part * fix path warning fix monaco editor * remove duplicate header * remove unused import * fix align and check ago tests * add missing import * fix notification button selector * [ANGULAR6] fixed core tests * fix CS test * fix cs test step 2 * increase travis_wait for dist * fix attachment PS * fix checklist test * use pdf min
This commit is contained in:
committed by
Eugenio Romano
parent
c510ec864d
commit
6b24bfb1d4
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { MinimalNodeEntity } from 'alfresco-js-api';
|
||||
import { Subject } from 'rxjs/Subject';
|
||||
import { Subject } from 'rxjs';
|
||||
|
||||
export interface AddPermissionDialogData {
|
||||
title?: string;
|
||||
|
@@ -23,7 +23,7 @@ import { By } from '@angular/platform-browser';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { AddPermissionDialogComponent } from './add-permission-dialog.component';
|
||||
import { MinimalNodeEntity } from 'alfresco-js-api';
|
||||
import { Subject } from 'rxjs/Subject';
|
||||
import { Subject } from 'rxjs';
|
||||
import { AddPermissionDialogData } from './add-permission-dialog-data.interface';
|
||||
import { fakeAuthorityResults } from '../../../mock/add-permission.component.mock';
|
||||
import { AddPermissionPanelComponent } from './add-permission-panel.component';
|
||||
|
@@ -19,7 +19,7 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { AddPermissionPanelComponent } from './add-permission-panel.component';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { SearchService, setupTestBed, SearchConfigurationService } from '@alfresco/adf-core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { of } from 'rxjs';
|
||||
import { fakeAuthorityListResult } from '../../../mock/add-permission.component.mock';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { DebugElement } from '@angular/core';
|
||||
@@ -63,7 +63,7 @@ describe('AddPermissionPanelComponent', () => {
|
||||
|
||||
it('should show search results when user types something', async(() => {
|
||||
searchApiService = fixture.componentRef.injector.get(SearchService);
|
||||
spyOn(searchApiService, 'search').and.returnValue(Observable.of(fakeAuthorityListResult));
|
||||
spyOn(searchApiService, 'search').and.returnValue(of(fakeAuthorityListResult));
|
||||
expect(element.querySelector('#adf-add-permission-type-search')).not.toBeNull();
|
||||
expect(element.querySelector('#searchInput')).not.toBeNull();
|
||||
typeWordIntoSearchInput('a');
|
||||
@@ -77,7 +77,7 @@ describe('AddPermissionPanelComponent', () => {
|
||||
|
||||
it('should emit a select event with the selected items when an item is clicked', async(() => {
|
||||
searchApiService = fixture.componentRef.injector.get(SearchService);
|
||||
spyOn(searchApiService, 'search').and.returnValue(Observable.of(fakeAuthorityListResult));
|
||||
spyOn(searchApiService, 'search').and.returnValue(of(fakeAuthorityListResult));
|
||||
component.select.subscribe((items) => {
|
||||
expect(items).not.toBeNull();
|
||||
expect(items[0].entry.id).toBeDefined();
|
||||
@@ -97,7 +97,7 @@ describe('AddPermissionPanelComponent', () => {
|
||||
|
||||
it('should show the icon related on the nodeType', async(() => {
|
||||
searchApiService = fixture.componentRef.injector.get(SearchService);
|
||||
spyOn(searchApiService, 'search').and.returnValue(Observable.of(fakeAuthorityListResult));
|
||||
spyOn(searchApiService, 'search').and.returnValue(of(fakeAuthorityListResult));
|
||||
expect(element.querySelector('#adf-add-permission-type-search')).not.toBeNull();
|
||||
expect(element.querySelector('#searchInput')).not.toBeNull();
|
||||
typeWordIntoSearchInput('a');
|
||||
@@ -114,7 +114,7 @@ describe('AddPermissionPanelComponent', () => {
|
||||
|
||||
it('should clear the search when user delete the search input field', async(() => {
|
||||
searchApiService = fixture.componentRef.injector.get(SearchService);
|
||||
spyOn(searchApiService, 'search').and.returnValue(Observable.of(fakeAuthorityListResult));
|
||||
spyOn(searchApiService, 'search').and.returnValue(of(fakeAuthorityListResult));
|
||||
expect(element.querySelector('#adf-add-permission-type-search')).not.toBeNull();
|
||||
expect(element.querySelector('#searchInput')).not.toBeNull();
|
||||
typeWordIntoSearchInput('a');
|
||||
@@ -135,7 +135,7 @@ describe('AddPermissionPanelComponent', () => {
|
||||
|
||||
it('should remove element from selection when is clicked and already selected', async(() => {
|
||||
searchApiService = fixture.componentRef.injector.get(SearchService);
|
||||
spyOn(searchApiService, 'search').and.returnValue(Observable.of(fakeAuthorityListResult));
|
||||
spyOn(searchApiService, 'search').and.returnValue(of(fakeAuthorityListResult));
|
||||
component.selectedItems.push(fakeAuthorityListResult.list.entries[0]);
|
||||
component.select.subscribe((items) => {
|
||||
expect(items).not.toBeNull();
|
||||
@@ -155,7 +155,7 @@ describe('AddPermissionPanelComponent', () => {
|
||||
|
||||
it('should always show as extra result the everyone group', async(() => {
|
||||
searchApiService = fixture.componentRef.injector.get(SearchService);
|
||||
spyOn(searchApiService, 'search').and.returnValue(Observable.of(fakeAuthorityListResult));
|
||||
spyOn(searchApiService, 'search').and.returnValue(of(fakeAuthorityListResult));
|
||||
component.selectedItems.push(fakeAuthorityListResult.list.entries[0]);
|
||||
|
||||
typeWordIntoSearchInput('a');
|
||||
@@ -174,7 +174,7 @@ describe('AddPermissionPanelComponent', () => {
|
||||
|
||||
it('should show everyone group when search return no result', async(() => {
|
||||
searchApiService = fixture.componentRef.injector.get(SearchService);
|
||||
spyOn(searchApiService, 'search').and.returnValue(Observable.of({ list: { entries: [] } }));
|
||||
spyOn(searchApiService, 'search').and.returnValue(of({ list: { entries: [] } }));
|
||||
component.selectedItems.push(fakeAuthorityListResult.list.entries[0]);
|
||||
|
||||
typeWordIntoSearchInput('a');
|
||||
|
@@ -20,7 +20,7 @@ import { AddPermissionComponent } from './add-permission.component';
|
||||
import { AddPermissionPanelComponent } from './add-permission-panel.component';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { setupTestBed, NodesApiService } from '@alfresco/adf-core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { of, throwError } from 'rxjs';
|
||||
import { fakeAuthorityResults } from '../../../mock/add-permission.component.mock';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { NodePermissionService } from '../../services/node-permission.service';
|
||||
@@ -40,7 +40,7 @@ describe('AddPermissionComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
nodeApiService = TestBed.get(NodesApiService);
|
||||
spyOn(nodeApiService, 'getNode').and.returnValue(Observable.of({ id: 'fake-node', allowableOperations: ['updatePermissions']}));
|
||||
spyOn(nodeApiService, 'getNode').and.returnValue(of({ id: 'fake-node', allowableOperations: ['updatePermissions']}));
|
||||
fixture = TestBed.createComponent(AddPermissionComponent);
|
||||
element = fixture.nativeElement;
|
||||
nodePermissionService = TestBed.get(NodePermissionService);
|
||||
@@ -83,7 +83,7 @@ describe('AddPermissionComponent', () => {
|
||||
|
||||
it('should emit a success event when the node is updated', (done) => {
|
||||
fixture.componentInstance.selectedItems = fakeAuthorityResults;
|
||||
spyOn(nodePermissionService, 'updateNodePermissions').and.returnValue(Observable.of({ id: 'fake-node-id'}));
|
||||
spyOn(nodePermissionService, 'updateNodePermissions').and.returnValue(of({ id: 'fake-node-id'}));
|
||||
|
||||
fixture.componentInstance.success.subscribe((node) => {
|
||||
expect(node.id).toBe('fake-node-id');
|
||||
@@ -101,7 +101,7 @@ describe('AddPermissionComponent', () => {
|
||||
it('should NOT emit a success event when the user does not have permission to update the node', () => {
|
||||
fixture.componentInstance.selectedItems = fakeAuthorityResults;
|
||||
fixture.componentInstance.currentNode = { id: 'fake-node-id' };
|
||||
spyOn(nodePermissionService, 'updateNodePermissions').and.returnValue(Observable.of({ id: 'fake-node-id' }));
|
||||
spyOn(nodePermissionService, 'updateNodePermissions').and.returnValue(of({ id: 'fake-node-id' }));
|
||||
|
||||
let spySuccess = spyOn(fixture.componentInstance, 'success');
|
||||
fixture.componentInstance.applySelection();
|
||||
@@ -110,7 +110,7 @@ describe('AddPermissionComponent', () => {
|
||||
|
||||
it('should emit an error event when the node update fail', (done) => {
|
||||
fixture.componentInstance.selectedItems = fakeAuthorityResults;
|
||||
spyOn(nodePermissionService, 'updateNodePermissions').and.returnValue(Observable.throw({ error: 'errored'}));
|
||||
spyOn(nodePermissionService, 'updateNodePermissions').and.returnValue(throwError({ error: 'errored'}));
|
||||
|
||||
fixture.componentInstance.error.subscribe((error) => {
|
||||
expect(error.error).toBe('errored');
|
||||
|
Reference in New Issue
Block a user