mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Pre-Angular 9 upgrade fixes (#5712)
* remove deprecated angular/http * upgrade adf libs * fix production builds * ivy-compatible translate module usage * improved module usage * upgrade content services module * fix process services tests * upgrade process cloud tests * lint fixes * update core max size * fix insights test module * remove insights lazy loading workaround * fix insights module exports * * Fixed skipped form-cloud unit test and removed duplicated tests * cleanup the use of services Co-authored-by: sivakumar414ram <siva.kumar@muraai.com>
This commit is contained in:
@@ -15,7 +15,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { TestBed, fakeAsync, ComponentFixture, tick } from '@angular/core/testing';
|
||||
import { MatDialogRef, MAT_DIALOG_DATA, MatDialog } from '@angular/material';
|
||||
import { of, empty } from 'rxjs';
|
||||
@@ -26,14 +25,13 @@ import {
|
||||
NotificationService,
|
||||
RenditionsService,
|
||||
AppConfigService,
|
||||
CoreModule,
|
||||
AppConfigServiceMock,
|
||||
AlfrescoApiService,
|
||||
AlfrescoApiServiceMock
|
||||
} from '@alfresco/adf-core';
|
||||
import { ContentNodeShareModule } from './content-node-share.module';
|
||||
import { ShareDialogComponent } from './content-node-share.dialog';
|
||||
import moment from 'moment-es6';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
|
||||
describe('ShareDialogComponent', () => {
|
||||
let node;
|
||||
@@ -50,9 +48,7 @@ describe('ShareDialogComponent', () => {
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
NoopAnimationsModule,
|
||||
CoreModule.forRoot(),
|
||||
ContentNodeShareModule
|
||||
ContentTestingModule
|
||||
],
|
||||
providers: [
|
||||
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
|
||||
|
@@ -15,18 +15,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { ReactiveFormsModule } from '@angular/forms';
|
||||
import { LibraryDialogComponent } from './library.dialog';
|
||||
import { TestBed, fakeAsync, tick, flush } from '@angular/core/testing';
|
||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { MatDialogRef } from '@angular/material';
|
||||
import {
|
||||
CoreModule,
|
||||
AlfrescoApiService,
|
||||
AlfrescoApiServiceMock,
|
||||
setupTestBed
|
||||
} from '@alfresco/adf-core';
|
||||
import { AlfrescoApiService, setupTestBed } from '@alfresco/adf-core';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
|
||||
describe('LibraryDialogComponent', () => {
|
||||
let fixture;
|
||||
@@ -39,13 +33,10 @@ describe('LibraryDialogComponent', () => {
|
||||
};
|
||||
|
||||
setupTestBed({
|
||||
imports: [NoopAnimationsModule, CoreModule.forRoot(), ReactiveFormsModule],
|
||||
declarations: [LibraryDialogComponent],
|
||||
imports: [
|
||||
ContentTestingModule
|
||||
],
|
||||
providers: [
|
||||
{
|
||||
provide: AlfrescoApiService,
|
||||
useClass: AlfrescoApiServiceMock
|
||||
},
|
||||
{ provide: MatDialogRef, useValue: dialogRef }
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
|
@@ -22,7 +22,8 @@ import { Component, DebugElement } from '@angular/core';
|
||||
import { NodeLockDirective } from './node-lock.directive';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
import { ContentNodeDialogService } from '../content-node-selector/content-node-dialog.service';
|
||||
import { CoreModule, setupTestBed } from '@alfresco/adf-core';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
|
||||
const fakeNode: Node = <Node> {
|
||||
id: 'fake',
|
||||
@@ -45,11 +46,10 @@ describe('NodeLock Directive', () => {
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
CoreModule.forRoot()
|
||||
ContentTestingModule
|
||||
],
|
||||
declarations: [
|
||||
TestComponent,
|
||||
NodeLockDirective
|
||||
TestComponent
|
||||
]
|
||||
});
|
||||
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { AlfrescoApiServiceMock, AppConfigService, ContentService,
|
||||
setupTestBed, CoreModule, TranslationMock, AlfrescoApiService, StorageService
|
||||
setupTestBed, TranslationMock, AlfrescoApiService, StorageService
|
||||
} from '@alfresco/adf-core';
|
||||
import { FileNode, FolderNode } from '../../mock';
|
||||
import { ContentActionHandler } from '../models/content-action.model';
|
||||
@@ -24,6 +24,7 @@ import { DocumentActionsService } from './document-actions.service';
|
||||
import { DocumentListService } from './document-list.service';
|
||||
import { of } from 'rxjs';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
|
||||
describe('DocumentActionsService', () => {
|
||||
|
||||
@@ -31,7 +32,9 @@ describe('DocumentActionsService', () => {
|
||||
let documentListService: DocumentListService;
|
||||
|
||||
setupTestBed({
|
||||
imports: [CoreModule.forRoot()],
|
||||
imports: [
|
||||
ContentTestingModule
|
||||
],
|
||||
providers: [
|
||||
{
|
||||
provide: AlfrescoApiService,
|
||||
|
@@ -16,10 +16,11 @@
|
||||
*/
|
||||
|
||||
import { AlfrescoApiServiceMock, AlfrescoApiService,
|
||||
AppConfigService, ContentService, setupTestBed, CoreModule, LogService, AppConfigServiceMock, StorageService } from '@alfresco/adf-core';
|
||||
AppConfigService, ContentService, setupTestBed, LogService, AppConfigServiceMock, StorageService } from '@alfresco/adf-core';
|
||||
import { DocumentListService } from './document-list.service';
|
||||
import { CustomResourcesService } from './custom-resources.service';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
|
||||
declare let jasmine: any;
|
||||
|
||||
@@ -64,7 +65,7 @@ describe('DocumentListService', () => {
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
CoreModule.forRoot()
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
|
@@ -16,13 +16,13 @@
|
||||
*/
|
||||
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { AlfrescoApiServiceMock, AppConfigService, ContentService, setupTestBed,
|
||||
CoreModule, TranslationMock, StorageService } from '@alfresco/adf-core';
|
||||
import { AlfrescoApiServiceMock, AppConfigService, ContentService, setupTestBed, TranslationMock, StorageService } from '@alfresco/adf-core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { FileNode, FolderNode } from '../../mock';
|
||||
import { ContentActionHandler } from '../models/content-action.model';
|
||||
import { DocumentListService } from './document-list.service';
|
||||
import { FolderActionsService } from './folder-actions.service';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
|
||||
describe('FolderActionsService', () => {
|
||||
|
||||
@@ -31,7 +31,7 @@ describe('FolderActionsService', () => {
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
CoreModule.forRoot()
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
|
@@ -17,13 +17,13 @@
|
||||
|
||||
import { async, TestBed } from '@angular/core/testing';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
import { AppConfigService, setupTestBed, CoreModule } from '@alfresco/adf-core';
|
||||
import { AppConfigService, setupTestBed } from '@alfresco/adf-core';
|
||||
import { DocumentListService } from './document-list.service';
|
||||
import { NodeActionsService } from './node-actions.service';
|
||||
import { ContentNodeDialogService } from '../../content-node-selector/content-node-dialog.service';
|
||||
import { of, throwError } from 'rxjs';
|
||||
import { MatDialogRef } from '@angular/material';
|
||||
import { DialogModule } from '../../dialogs/dialog.module';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
|
||||
const fakeNode: Node = <Node> {
|
||||
id: 'fake'
|
||||
@@ -40,8 +40,7 @@ describe('NodeActionsService', () => {
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
CoreModule.forRoot(),
|
||||
DialogModule
|
||||
ContentTestingModule
|
||||
],
|
||||
providers: [
|
||||
{ provide: MatDialogRef, useValue: dialogRef }
|
||||
|
@@ -20,11 +20,11 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { MatDialog } from '@angular/material';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { Subject, of } from 'rxjs';
|
||||
import { FolderDialogComponent } from '../dialogs/folder.dialog';
|
||||
|
||||
import { ContentService, setupTestBed, CoreModule } from '@alfresco/adf-core';
|
||||
import { ContentService, setupTestBed } from '@alfresco/adf-core';
|
||||
import { FolderCreateDirective } from './folder-create.directive';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
|
||||
@Component({
|
||||
template: `
|
||||
@@ -63,13 +63,11 @@ describe('FolderCreateDirective', () => {
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
CoreModule.forRoot()
|
||||
ContentTestingModule
|
||||
],
|
||||
declarations: [
|
||||
TestTypeComponent,
|
||||
TestComponent,
|
||||
FolderDialogComponent,
|
||||
FolderCreateDirective
|
||||
TestComponent
|
||||
]
|
||||
});
|
||||
|
||||
|
@@ -21,9 +21,10 @@ import { MatDialog } from '@angular/material';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { Subject, of } from 'rxjs';
|
||||
|
||||
import { ContentService, setupTestBed, CoreModule } from '@alfresco/adf-core';
|
||||
import { ContentService, setupTestBed } from '@alfresco/adf-core';
|
||||
import { FolderEditDirective } from './folder-edit.directive';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
|
||||
@Component({
|
||||
template: '<div [adf-edit-folder]="folder" (success)="success($event)" title="edit-title"></div>'
|
||||
@@ -51,11 +52,10 @@ describe('FolderEditDirective', () => {
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
CoreModule.forRoot()
|
||||
ContentTestingModule
|
||||
],
|
||||
declarations: [
|
||||
TestComponent,
|
||||
FolderEditDirective
|
||||
TestComponent
|
||||
]
|
||||
});
|
||||
|
||||
|
@@ -17,9 +17,9 @@
|
||||
|
||||
import { SimpleInheritedPermissionTestComponent } from '../../mock/inherited-permission.component.mock';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { InheritPermissionDirective } from './inherited-button.directive';
|
||||
import { NodesApiService, setupTestBed, CoreModule } from '@alfresco/adf-core';
|
||||
import { NodesApiService, setupTestBed } from '@alfresco/adf-core';
|
||||
import { of } from 'rxjs';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
|
||||
const fakeNodeWithInherit: any = { id: 'fake-id', permissions : {isInheritanceEnabled : true}, allowableOperations: ['updatePermissions']};
|
||||
const fakeNodeNoInherit: any = { id: 'fake-id', permissions : {isInheritanceEnabled : false}, allowableOperations: ['updatePermissions']};
|
||||
@@ -34,10 +34,9 @@ describe('InheritPermissionDirective', () => {
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
CoreModule.forRoot()
|
||||
ContentTestingModule
|
||||
],
|
||||
declarations: [
|
||||
InheritPermissionDirective,
|
||||
SimpleInheritedPermissionTestComponent
|
||||
]
|
||||
});
|
||||
|
@@ -17,12 +17,13 @@
|
||||
|
||||
import { async, TestBed } from '@angular/core/testing';
|
||||
import { NodePermissionService } from './node-permission.service';
|
||||
import { SearchService, NodesApiService, setupTestBed, CoreModule } from '@alfresco/adf-core';
|
||||
import { SearchService, NodesApiService, setupTestBed } from '@alfresco/adf-core';
|
||||
import { Node, PermissionElement } from '@alfresco/js-api';
|
||||
import { of } from 'rxjs';
|
||||
import { fakeEmptyResponse, fakeNodeWithOnlyLocally, fakeSiteRoles, fakeSiteNodeResponse,
|
||||
fakeNodeToRemovePermission, fakeNodeWithoutPermissions } from '../../mock/permission-list.component.mock';
|
||||
import { fakeAuthorityResults } from '../../mock/add-permission.component.mock';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
|
||||
describe('NodePermissionService', () => {
|
||||
|
||||
@@ -32,7 +33,7 @@ describe('NodePermissionService', () => {
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
CoreModule.forRoot()
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
|
@@ -16,11 +16,11 @@
|
||||
*/
|
||||
|
||||
import { Component } from '@angular/core';
|
||||
import { CoreModule, setupTestBed } from '@alfresco/adf-core';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { TestBed, ComponentFixture } from '@angular/core/testing';
|
||||
import { SearchModule } from '../../search.module';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { SelectedBucket } from '../search-filter/search-filter.component';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-test-component',
|
||||
@@ -45,8 +45,7 @@ describe('SearchChipListComponent', () => {
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
CoreModule.forRoot(),
|
||||
SearchModule
|
||||
ContentTestingModule
|
||||
],
|
||||
declarations: [
|
||||
TestComponent
|
||||
|
@@ -22,16 +22,13 @@ import {
|
||||
AuthenticationService,
|
||||
SearchService,
|
||||
setupTestBed,
|
||||
CoreModule,
|
||||
UserPreferencesService,
|
||||
SearchTextInputComponent
|
||||
} from '@alfresco/adf-core';
|
||||
import { noResult, results } from '../../mock';
|
||||
import { SearchControlComponent } from './search-control.component';
|
||||
import { SearchComponent } from './search.component';
|
||||
import { EmptySearchResultComponent } from './empty-search-result.component';
|
||||
import { of } from 'rxjs';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
|
||||
@Component({
|
||||
template: `
|
||||
@@ -68,13 +65,9 @@ describe('SearchControlComponent', () => {
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
NoopAnimationsModule,
|
||||
CoreModule.forRoot()
|
||||
ContentTestingModule
|
||||
],
|
||||
declarations: [
|
||||
SearchControlComponent,
|
||||
SearchComponent,
|
||||
EmptySearchResultComponent,
|
||||
SimpleSearchTestCustomEmptyComponent
|
||||
]
|
||||
});
|
||||
|
@@ -16,10 +16,10 @@
|
||||
*/
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { SearchService, setupTestBed, CoreModule } from '@alfresco/adf-core';
|
||||
import { SearchService, setupTestBed } from '@alfresco/adf-core';
|
||||
import { differentResult, result, SimpleSearchTestComponent } from '../../mock';
|
||||
import { of, throwError } from 'rxjs';
|
||||
import { SearchModule } from '../search.module';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
|
||||
describe('SearchComponent', () => {
|
||||
|
||||
@@ -29,8 +29,7 @@ describe('SearchComponent', () => {
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
CoreModule.forRoot(),
|
||||
SearchModule
|
||||
ContentTestingModule
|
||||
],
|
||||
declarations: [SimpleSearchTestComponent]
|
||||
});
|
||||
|
@@ -19,15 +19,15 @@ import { DebugElement } from '@angular/core';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { DropdownSitesComponent, Relations } from './sites-dropdown.component';
|
||||
import { SitesService, setupTestBed, CoreModule, AlfrescoApiService, AlfrescoApiServiceMock } from '@alfresco/adf-core';
|
||||
import { SitesService, setupTestBed } from '@alfresco/adf-core';
|
||||
import { of } from 'rxjs';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { getFakeSitePaging,
|
||||
getFakeSitePagingNoMoreItems,
|
||||
getFakeSitePagingFirstPage,
|
||||
getFakeSitePagingLastPage,
|
||||
getFakeSitePagingWithMembers
|
||||
} from '../mock';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
|
||||
const customSiteList = {
|
||||
'list': {
|
||||
@@ -58,14 +58,7 @@ describe('DropdownSitesComponent', () => {
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
NoopAnimationsModule,
|
||||
CoreModule.forRoot()
|
||||
],
|
||||
declarations: [
|
||||
DropdownSitesComponent
|
||||
],
|
||||
providers: [
|
||||
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock }
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
|
@@ -30,11 +30,13 @@ import {
|
||||
CookieServiceMock
|
||||
} from '@alfresco/adf-core';
|
||||
import { ContentModule } from '../content.module';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
NoopAnimationsModule,
|
||||
RouterTestingModule,
|
||||
TranslateModule.forRoot(),
|
||||
CoreModule.forRoot(),
|
||||
ContentModule.forRoot()
|
||||
],
|
||||
@@ -43,6 +45,12 @@ import { ContentModule } from '../content.module';
|
||||
{ provide: AppConfigService, useClass: AppConfigServiceMock },
|
||||
{ provide: TranslationService, useClass: TranslationMock },
|
||||
{ provide: CookieService, useClass: CookieServiceMock }
|
||||
],
|
||||
exports: [
|
||||
NoopAnimationsModule,
|
||||
TranslateModule,
|
||||
CoreModule,
|
||||
ContentModule
|
||||
]
|
||||
})
|
||||
export class ContentTestingModule {}
|
||||
|
@@ -17,10 +17,10 @@
|
||||
|
||||
import { Component, NgZone } from '@angular/core';
|
||||
import { ComponentFixture, TestBed, fakeAsync, tick } from '@angular/core/testing';
|
||||
import { TranslationService, UploadService, setupTestBed, CoreModule, FileModel, TranslationMock } from '@alfresco/adf-core';
|
||||
import { TranslationService, UploadService, setupTestBed, FileModel } from '@alfresco/adf-core';
|
||||
import { UploadBase } from './upload-base';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { UploadFilesEvent } from '../upload-files.event';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-upload-button-test',
|
||||
@@ -43,15 +43,10 @@ describe('UploadBase', () => {
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
NoopAnimationsModule,
|
||||
CoreModule.forRoot()
|
||||
ContentTestingModule
|
||||
],
|
||||
declarations: [
|
||||
UploadTestComponent
|
||||
],
|
||||
providers: [
|
||||
UploadService,
|
||||
{ provide: TranslationService, useClass: TranslationMock }
|
||||
]
|
||||
});
|
||||
|
||||
|
@@ -18,11 +18,11 @@
|
||||
import { EventEmitter } from '@angular/core';
|
||||
import { ComponentFixture, TestBed, fakeAsync, tick } from '@angular/core/testing';
|
||||
import {
|
||||
FileModel, FileUploadCompleteEvent, FileUploadErrorEvent, UploadService, setupTestBed, CoreModule, AlfrescoApiService, AlfrescoApiServiceMock, UserPreferencesService
|
||||
FileModel, FileUploadCompleteEvent, FileUploadErrorEvent, UploadService, setupTestBed, AlfrescoApiService, AlfrescoApiServiceMock, UserPreferencesService
|
||||
} from '@alfresco/adf-core';
|
||||
import { UploadModule } from '../upload.module';
|
||||
import { FileUploadingDialogComponent } from './file-uploading-dialog.component';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
|
||||
describe('FileUploadingDialogComponent', () => {
|
||||
let fixture: ComponentFixture<FileUploadingDialogComponent>;
|
||||
@@ -34,8 +34,7 @@ describe('FileUploadingDialogComponent', () => {
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
NoopAnimationsModule,
|
||||
CoreModule.forRoot(),
|
||||
ContentTestingModule,
|
||||
UploadModule
|
||||
],
|
||||
providers: [
|
||||
|
@@ -16,9 +16,9 @@
|
||||
*/
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { FileModel, CoreModule, FileUploadOptions, FileUploadStatus, setupTestBed } from '@alfresco/adf-core';
|
||||
import { UploadModule } from '../upload.module';
|
||||
import { FileModel, FileUploadOptions, FileUploadStatus, setupTestBed } from '@alfresco/adf-core';
|
||||
import { FileUploadingListRowComponent } from './file-uploading-list-row.component';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
|
||||
describe('FileUploadingListRowComponent', () => {
|
||||
let fixture: ComponentFixture<FileUploadingListRowComponent>;
|
||||
@@ -27,8 +27,7 @@ describe('FileUploadingListRowComponent', () => {
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
CoreModule.forRoot(),
|
||||
UploadModule
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
|
@@ -16,13 +16,10 @@
|
||||
*/
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { TranslationService, FileUploadStatus, NodesApiService, UploadService,
|
||||
setupTestBed, CoreModule, AlfrescoApiService, AlfrescoApiServiceMock
|
||||
} from '@alfresco/adf-core';
|
||||
import { TranslationService, FileUploadStatus, NodesApiService, UploadService, setupTestBed } from '@alfresco/adf-core';
|
||||
import { of, throwError } from 'rxjs';
|
||||
import { UploadModule } from '../upload.module';
|
||||
import { FileUploadingListComponent } from './file-uploading-list.component';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
|
||||
describe('FileUploadingListComponent', () => {
|
||||
let fixture: ComponentFixture<FileUploadingListComponent>;
|
||||
@@ -38,12 +35,7 @@ describe('FileUploadingListComponent', () => {
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
NoopAnimationsModule,
|
||||
CoreModule.forRoot(),
|
||||
UploadModule
|
||||
],
|
||||
providers: [
|
||||
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock }
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
|
@@ -17,11 +17,11 @@
|
||||
|
||||
import { SimpleChange } from '@angular/core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ContentService, UploadService, TranslationService, setupTestBed, CoreModule, TranslationMock } from '@alfresco/adf-core';
|
||||
import { ContentService, UploadService, setupTestBed } from '@alfresco/adf-core';
|
||||
import { of, throwError } from 'rxjs';
|
||||
import { UploadButtonComponent } from './upload-button.component';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { NodeEntry } from '@alfresco/js-api';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
|
||||
describe('UploadButtonComponent', () => {
|
||||
|
||||
@@ -52,14 +52,7 @@ describe('UploadButtonComponent', () => {
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
NoopAnimationsModule,
|
||||
CoreModule.forRoot()
|
||||
],
|
||||
declarations: [
|
||||
UploadButtonComponent
|
||||
],
|
||||
providers: [
|
||||
{ provide: TranslationService, useClass: TranslationMock }
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
|
@@ -16,17 +16,9 @@
|
||||
*/
|
||||
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import {
|
||||
AlfrescoApiService,
|
||||
AlfrescoApiServiceMock,
|
||||
FileModel,
|
||||
UploadService,
|
||||
setupTestBed,
|
||||
CoreModule
|
||||
} from '@alfresco/adf-core';
|
||||
|
||||
import { FileDraggableDirective } from '../directives/file-draggable.directive';
|
||||
import { FileModel, UploadService, setupTestBed } from '@alfresco/adf-core';
|
||||
import { UploadDragAreaComponent } from './upload-drag-area.component';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
|
||||
function getFakeShareDataRow(allowableOperations = ['delete', 'update', 'create']) {
|
||||
return {
|
||||
@@ -103,14 +95,7 @@ describe('UploadDragAreaComponent', () => {
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
CoreModule.forRoot()
|
||||
],
|
||||
declarations: [
|
||||
FileDraggableDirective,
|
||||
UploadDragAreaComponent
|
||||
],
|
||||
providers: [
|
||||
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock }
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
|
@@ -19,11 +19,11 @@ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { ComponentFixture, TestBed, fakeAsync, tick } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { VersionListComponent } from './version-list.component';
|
||||
import { AlfrescoApiService, setupTestBed, CoreModule, AlfrescoApiServiceMock } from '@alfresco/adf-core';
|
||||
import { AlfrescoApiService, setupTestBed, AlfrescoApiServiceMock } from '@alfresco/adf-core';
|
||||
import { MatDialog } from '@angular/material';
|
||||
import { of } from 'rxjs';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { Node, VersionPaging, VersionEntry } from '@alfresco/js-api';
|
||||
import { CoreTestingModule } from '../../../../core/testing/core.testing.module';
|
||||
|
||||
describe('VersionListComponent', () => {
|
||||
let component: VersionListComponent;
|
||||
@@ -45,8 +45,7 @@ describe('VersionListComponent', () => {
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
CoreModule.forRoot(),
|
||||
NoopAnimationsModule
|
||||
CoreTestingModule
|
||||
],
|
||||
declarations: [
|
||||
VersionListComponent
|
||||
|
@@ -18,11 +18,10 @@
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { AlfrescoApiService, setupTestBed, CoreModule, AlfrescoApiServiceMock } from '@alfresco/adf-core';
|
||||
import { AlfrescoApiService, setupTestBed } from '@alfresco/adf-core';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
import { VersionManagerComponent } from './version-manager.component';
|
||||
import { VersionListComponent } from './version-list.component';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
|
||||
describe('VersionManagerComponent', () => {
|
||||
let component: VersionManagerComponent;
|
||||
@@ -46,15 +45,7 @@ describe('VersionManagerComponent', () => {
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
CoreModule.forRoot(),
|
||||
NoopAnimationsModule
|
||||
],
|
||||
declarations: [
|
||||
VersionManagerComponent,
|
||||
VersionListComponent
|
||||
],
|
||||
providers: [
|
||||
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock }
|
||||
ContentTestingModule
|
||||
],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
});
|
||||
|
@@ -16,8 +16,9 @@
|
||||
*/
|
||||
|
||||
import { ComponentFixture, TestBed, async } from '@angular/core/testing';
|
||||
import { AppConfigService, setupTestBed, CoreModule } from '@alfresco/adf-core';
|
||||
import { AppConfigService, setupTestBed } from '@alfresco/adf-core';
|
||||
import { WebscriptComponent } from './webscript.component';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
|
||||
declare let jasmine: any;
|
||||
|
||||
@@ -29,10 +30,7 @@ describe('WebscriptComponent', () => {
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
CoreModule.forRoot()
|
||||
],
|
||||
declarations: [
|
||||
WebscriptComponent
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user