mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-10-01 14:41:32 +00:00
[ACS-5620] stabilise unit tests by switching to standard Angular api (#8759)
* switch to standard TestBed api for unit testing * test fixes * test fixes * test fixes * test fixes * test fixes * test fixes * test fixes * test fixes * test fixes
This commit is contained in:
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { NodesApiService } from '../common/services/nodes-api.service';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
@@ -110,12 +109,14 @@ describe('AspectListComponent', () => {
|
||||
let aspectListService: AspectListService;
|
||||
let nodeService: NodesApiService;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
providers: [AspectListService]
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
providers: [AspectListService]
|
||||
});
|
||||
});
|
||||
|
||||
describe('Loading', () => {
|
||||
|
@@ -15,7 +15,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { DialogAspectListService } from '@alfresco/adf-content-services';
|
||||
@@ -27,14 +26,13 @@ describe('DialogAspectListService', () => {
|
||||
let dialogAspectListService: DialogAspectListService;
|
||||
let dialog: MatDialog;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
dialogAspectListService = TestBed.inject(DialogAspectListService);
|
||||
dialog = TestBed.inject(MatDialog);
|
||||
});
|
||||
|
@@ -18,7 +18,6 @@
|
||||
import { MinimalNode } from '@alfresco/js-api';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { NodesApiService } from '../../common/services/nodes-api.service';
|
||||
import { EMPTY, of } from 'rxjs';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
@@ -34,14 +33,13 @@ describe('NodeAspectService', () => {
|
||||
let nodeApiService: NodesApiService;
|
||||
let cardViewContentUpdateService: CardViewContentUpdateService;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
dialogAspectListService = TestBed.inject(DialogAspectListService);
|
||||
nodeAspectService = TestBed.inject(NodeAspectService);
|
||||
nodeApiService = TestBed.inject(NodesApiService);
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { AuditService } from './audit.service';
|
||||
import { AppConfigService, setupTestBed } from '@alfresco/adf-core';
|
||||
import { AppConfigService } from '@alfresco/adf-core';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
@@ -26,14 +26,13 @@ declare let jasmine: any;
|
||||
describe('AuditService', () => {
|
||||
let service: AuditService;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
const appConfig: AppConfigService = TestBed.inject(AppConfigService);
|
||||
appConfig.config = {
|
||||
ecmHost: 'http://localhost:9876/ecm',
|
||||
|
@@ -18,7 +18,6 @@
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { fakeNodeWithCreatePermission } from '../mock';
|
||||
import { DocumentListComponent, DocumentListService } from '../document-list';
|
||||
import { BreadcrumbComponent } from './breadcrumb.component';
|
||||
@@ -36,16 +35,15 @@ describe('Breadcrumb', () => {
|
||||
});
|
||||
let documentListComponent: DocumentListComponent;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
providers : [{ provide: DocumentListService, useValue: documentListService }]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
providers : [{ provide: DocumentListService, useValue: documentListService }]
|
||||
});
|
||||
fixture = TestBed.createComponent(BreadcrumbComponent);
|
||||
component = fixture.componentInstance;
|
||||
documentListComponent = TestBed.createComponent<DocumentListComponent>(DocumentListComponent).componentInstance;
|
||||
|
@@ -18,7 +18,6 @@
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { fakeNodeWithCreatePermission } from '../mock';
|
||||
import { DocumentListComponent, DocumentListService } from '../document-list';
|
||||
import { DropdownBreadcrumbComponent } from './dropdown-breadcrumb.component';
|
||||
@@ -33,16 +32,15 @@ describe('DropdownBreadcrumb', () => {
|
||||
let documentList: DocumentListComponent;
|
||||
let documentListService: DocumentListService = jasmine.createSpyObj({ loadFolderByNodeId: of(''), isCustomSourceService: false });
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
providers: [{ provide: DocumentListService, useValue: documentListService }]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
providers: [{ provide: DocumentListService, useValue: documentListService }]
|
||||
});
|
||||
fixture = TestBed.createComponent(DropdownBreadcrumbComponent);
|
||||
component = fixture.componentInstance;
|
||||
documentList = TestBed.createComponent<DocumentListComponent>(DocumentListComponent).componentInstance;
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { ContentService } from './content.service';
|
||||
import { AppConfigService, AuthenticationService, StorageService, setupTestBed, CoreTestingModule } from '@alfresco/adf-core';
|
||||
import { AppConfigService, AuthenticationService, StorageService, CoreTestingModule } from '@alfresco/adf-core';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
@@ -32,14 +32,13 @@ describe('ContentService', () => {
|
||||
|
||||
const nodeId = 'fake-node-id';
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
CoreTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
CoreTestingModule
|
||||
]
|
||||
});
|
||||
authService = TestBed.inject(AuthenticationService);
|
||||
contentService = TestBed.inject(ContentService);
|
||||
storage = TestBed.inject(StorageService);
|
||||
|
@@ -16,24 +16,22 @@
|
||||
*/
|
||||
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { AppConfigService, setupTestBed, CoreTestingModule } from '@alfresco/adf-core';
|
||||
import { AppConfigService, CoreTestingModule } from '@alfresco/adf-core';
|
||||
import { SitesService } from './sites.service';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
declare let jasmine: any;
|
||||
|
||||
describe('Sites service', () => {
|
||||
|
||||
let service;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
CoreTestingModule
|
||||
]
|
||||
});
|
||||
let service: SitesService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
CoreTestingModule
|
||||
]
|
||||
});
|
||||
const appConfig: AppConfigService = TestBed.inject(AppConfigService);
|
||||
appConfig.config = {
|
||||
ecmHost: 'http://localhost:9876/ecm',
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { EventEmitter } from '@angular/core';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { AppConfigModule, AppConfigService, setupTestBed, CoreTestingModule } from '@alfresco/adf-core';
|
||||
import { AppConfigModule, AppConfigService, CoreTestingModule } from '@alfresco/adf-core';
|
||||
import { UploadService } from './upload.service';
|
||||
import { RepositoryInfo } from '@alfresco/js-api';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
@@ -34,23 +34,22 @@ describe('UploadService', () => {
|
||||
|
||||
const mockProductInfo = new BehaviorSubject<RepositoryInfo>(null);
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
CoreTestingModule,
|
||||
AppConfigModule
|
||||
],
|
||||
providers: [
|
||||
{
|
||||
provide: DiscoveryApiService,
|
||||
useValue: {
|
||||
ecmProductInfo$: mockProductInfo
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
CoreTestingModule,
|
||||
AppConfigModule
|
||||
],
|
||||
providers: [
|
||||
{
|
||||
provide: DiscoveryApiService,
|
||||
useValue: {
|
||||
ecmProductInfo$: mockProductInfo
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
appConfigService = TestBed.inject(AppConfigService);
|
||||
appConfigService.config = {
|
||||
ecmHost: 'http://localhost:9876/ecm',
|
||||
|
@@ -20,7 +20,6 @@ import { By } from '@angular/platform-browser';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
import { ContentMetadataCardComponent } from './content-metadata-card.component';
|
||||
import { ContentMetadataComponent } from '../content-metadata/content-metadata.component';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { SimpleChange } from '@angular/core';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
@@ -38,14 +37,13 @@ describe('ContentMetadataCardComponent', () => {
|
||||
const preset = 'custom-preset';
|
||||
let nodeAspectService: NodeAspectService = null;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
fixture = TestBed.createComponent(ContentMetadataCardComponent);
|
||||
contentMetadataService = TestBed.inject(ContentMetadataService);
|
||||
component = fixture.componentInstance;
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ComponentFixture, TestBed, tick, fakeAsync } from '@angular/core/testing';
|
||||
import { ComponentFixture, TestBed, tick, fakeAsync, discardPeriodicTasks, flush } from '@angular/core/testing';
|
||||
import { DebugElement, SimpleChange } from '@angular/core';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { Category, CategoryPaging, ClassesApi, MinimalNode, Node, Tag, TagBody, TagEntry, TagPaging, TagPagingList } from '@alfresco/js-api';
|
||||
@@ -23,7 +23,7 @@ import { ContentMetadataComponent } from './content-metadata.component';
|
||||
import { ContentMetadataService } from '../../services/content-metadata.service';
|
||||
import {
|
||||
CardViewBaseItemModel, CardViewComponent,
|
||||
LogService, setupTestBed, AppConfigService, UpdateNotification
|
||||
LogService, AppConfigService, UpdateNotification
|
||||
} from '@alfresco/adf-core';
|
||||
import { NodesApiService } from '../../../common/services/nodes-api.service';
|
||||
import { throwError, of, EMPTY } from 'rxjs';
|
||||
@@ -100,37 +100,37 @@ describe('ContentMetadataComponent', () => {
|
||||
return fixture.debugElement.query(By.css('.adf-metadata-categories-title button')).nativeElement;
|
||||
}
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
providers: [
|
||||
{
|
||||
provide: LogService,
|
||||
useValue: {
|
||||
error: jasmine.createSpy('error')
|
||||
}
|
||||
},
|
||||
{
|
||||
provide: TagService,
|
||||
useValue: {
|
||||
getTagsByNodeId: () => EMPTY,
|
||||
removeTag: () => EMPTY,
|
||||
assignTagsToNode: () => EMPTY
|
||||
}
|
||||
},
|
||||
{
|
||||
provide: CategoryService,
|
||||
useValue: {
|
||||
getCategoryLinksForNode: () => EMPTY,
|
||||
linkNodeToCategory: () => EMPTY,
|
||||
unlinkNodeFromCategory: () => EMPTY
|
||||
}
|
||||
}]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
providers: [
|
||||
{
|
||||
provide: LogService,
|
||||
useValue: {
|
||||
error: jasmine.createSpy('error')
|
||||
}
|
||||
},
|
||||
{
|
||||
provide: TagService,
|
||||
useValue: {
|
||||
getTagsByNodeId: () => EMPTY,
|
||||
removeTag: () => EMPTY,
|
||||
assignTagsToNode: () => EMPTY
|
||||
}
|
||||
},
|
||||
{
|
||||
provide: CategoryService,
|
||||
useValue: {
|
||||
getCategoryLinksForNode: () => EMPTY,
|
||||
linkNodeToCategory: () => EMPTY,
|
||||
unlinkNodeFromCategory: () => EMPTY
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
fixture = TestBed.createComponent(ContentMetadataComponent);
|
||||
component = fixture.componentInstance;
|
||||
contentMetadataService = TestBed.inject(ContentMetadataService);
|
||||
@@ -290,7 +290,7 @@ describe('ContentMetadataComponent', () => {
|
||||
expect(tagService.getTagsByNodeId).toHaveBeenCalledWith(node.id);
|
||||
}));
|
||||
|
||||
it('should throw error on unsuccessful save', fakeAsync((done) => {
|
||||
it('should throw error on unsuccessful save', fakeAsync(() => {
|
||||
const logService: LogService = TestBed.inject(LogService);
|
||||
component.editable = true;
|
||||
const property = { key: 'properties.property-key', value: 'original-value' } as CardViewBaseItemModel;
|
||||
@@ -302,13 +302,14 @@ describe('ContentMetadataComponent', () => {
|
||||
expect(err.statusCode).toBe(0);
|
||||
expect(err.message).toBe('METADATA.ERRORS.GENERIC');
|
||||
sub.unsubscribe();
|
||||
done();
|
||||
});
|
||||
|
||||
spyOn(nodesApiService, 'updateNode').and.returnValue(throwError(new Error('My bad')));
|
||||
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => clickOnSave());
|
||||
discardPeriodicTasks();
|
||||
flush();
|
||||
}));
|
||||
|
||||
it('should open the confirm dialog when content type is changed', fakeAsync(() => {
|
||||
@@ -329,6 +330,7 @@ describe('ContentMetadataComponent', () => {
|
||||
expect(component.node).toEqual(expectedNode);
|
||||
expect(contentMetadataService.openConfirmDialog).toHaveBeenCalledWith({nodeType: 'ft:poppoli'});
|
||||
expect(nodesApiService.updateNode).toHaveBeenCalled();
|
||||
discardPeriodicTasks();
|
||||
}));
|
||||
|
||||
it('should call removeTag and assignTagsToNode on TagService after confirming confirmation dialog when content type is changed', fakeAsync(() => {
|
||||
@@ -1241,6 +1243,8 @@ describe('ContentMetadataComponent', () => {
|
||||
expect(categories[0].textContent).toBe(category1.name);
|
||||
expect(categories[1].textContent).toBe(category2.name);
|
||||
expect(categoryService.getCategoryLinksForNode).toHaveBeenCalledWith(node.id);
|
||||
discardPeriodicTasks();
|
||||
flush();
|
||||
}));
|
||||
|
||||
it('should be hidden when editable is true', () => {
|
||||
@@ -1333,6 +1337,8 @@ describe('ContentMetadataComponent', () => {
|
||||
clickOnSave();
|
||||
|
||||
expect(categoriesManagementComponent.disableRemoval).toBeFalse();
|
||||
discardPeriodicTasks();
|
||||
flush();
|
||||
}));
|
||||
|
||||
it('should set categoryNameControlVisible to false after saving', () => {
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { AppConfigService, LogService, setupTestBed } from '@alfresco/adf-core';
|
||||
import { AppConfigService, LogService } from '@alfresco/adf-core';
|
||||
import { IndifferentConfigService } from './indifferent-config.service';
|
||||
import { AspectOrientedConfigService } from './aspect-oriented-config.service';
|
||||
import { LayoutOrientedConfigService } from './layout-oriented-config.service';
|
||||
@@ -30,20 +30,19 @@ describe('ContentMetadataConfigFactory', () => {
|
||||
let appConfig: AppConfigService;
|
||||
let config: ContentMetadataConfig;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
HttpClientModule
|
||||
],
|
||||
providers: [
|
||||
{
|
||||
provide: LogService, useValue: {
|
||||
error: () => {}
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
HttpClientModule
|
||||
],
|
||||
providers: [
|
||||
{
|
||||
provide: LogService, useValue: {
|
||||
error: () => {}
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
factory = TestBed.inject(ContentMetadataConfigFactory);
|
||||
appConfig = TestBed.inject(AppConfigService);
|
||||
});
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AppConfigService, setupTestBed } from '@alfresco/adf-core';
|
||||
import { AppConfigService } from '@alfresco/adf-core';
|
||||
import { ClassesApi, Node } from '@alfresco/js-api';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { ContentMetadataService } from './content-metadata.service';
|
||||
@@ -138,10 +138,6 @@ describe('ContentMetaDataService', () => {
|
||||
}
|
||||
};
|
||||
|
||||
setupTestBed({
|
||||
imports: [TranslateModule.forRoot(), ContentTestingModule]
|
||||
});
|
||||
|
||||
const setConfig = (presetName, presetConfig) => {
|
||||
appConfig.config['content-metadata'] = {
|
||||
presets: {
|
||||
@@ -151,6 +147,9 @@ describe('ContentMetaDataService', () => {
|
||||
};
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [TranslateModule.forRoot(), ContentTestingModule]
|
||||
});
|
||||
service = TestBed.inject(ContentMetadataService);
|
||||
contentPropertyService = TestBed.inject(ContentTypePropertiesService);
|
||||
const propertyDescriptorsService = TestBed.inject(
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { ContentTypePropertiesService } from './content-type-property.service';
|
||||
import { CardViewItem, CardViewSelectItemModel, CardViewTextItemModel, setupTestBed } from '@alfresco/adf-core';
|
||||
import { CardViewItem, CardViewSelectItemModel, CardViewTextItemModel } from '@alfresco/adf-core';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { ContentTypeService } from '../../content-type';
|
||||
@@ -114,14 +114,13 @@ describe('ContentTypePropertyService', () => {
|
||||
}
|
||||
];
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
service = TestBed.inject(ContentTypePropertiesService);
|
||||
versionCompatibilityService = TestBed.inject(VersionCompatibilityService);
|
||||
contentTypeService = TestBed.inject(ContentTypeService);
|
||||
|
@@ -17,7 +17,6 @@
|
||||
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { PropertyDescriptorsService } from './property-descriptors.service';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { ClassesApi } from '@alfresco/js-api';
|
||||
import { PropertyGroup } from '../interfaces/content-metadata.interfaces';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
@@ -28,14 +27,13 @@ describe('PropertyDescriptorLoaderService', () => {
|
||||
let service: PropertyDescriptorsService;
|
||||
let classesApi: ClassesApi;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
service = TestBed.inject(PropertyDescriptorsService);
|
||||
classesApi = service['classesApi'];
|
||||
});
|
||||
|
@@ -29,7 +29,6 @@ import {
|
||||
CardViewBoolItemModel,
|
||||
CardViewDatetimeItemModel,
|
||||
CardViewSelectItemModel,
|
||||
setupTestBed,
|
||||
CardViewSelectItemProperties
|
||||
} from '@alfresco/adf-core';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
@@ -45,14 +44,13 @@ describe('PropertyGroupTranslatorService', () => {
|
||||
let propertyValues: { [key: string]: any };
|
||||
let logService: LogService;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
logService = TestBed.inject(LogService);
|
||||
service = TestBed.inject(PropertyGroupTranslatorService);
|
||||
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { TestBed, fakeAsync, tick } from '@angular/core/testing';
|
||||
import { NodeEntry, Node, SitePaging, Site } from '@alfresco/js-api';
|
||||
import { AppConfigService, setupTestBed } from '@alfresco/adf-core';
|
||||
import { AppConfigService } from '@alfresco/adf-core';
|
||||
import { DocumentListService } from '../document-list/services/document-list.service';
|
||||
import { ContentNodeDialogService } from './content-node-dialog.service';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
@@ -69,14 +69,13 @@ describe('ContentNodeDialogService', () => {
|
||||
let spyOnDialogOpen: jasmine.Spy;
|
||||
let afterOpenObservable: Subject<any>;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
const appConfig: AppConfigService = TestBed.inject(AppConfigService);
|
||||
appConfig.config.ecmHost = 'http://localhost:9876/ecm';
|
||||
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
|
||||
import { ComponentFixture, fakeAsync, flush, TestBed, tick } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import {
|
||||
MinimalNode,
|
||||
@@ -28,7 +28,6 @@ import {
|
||||
SiteEntry,
|
||||
SitePaging
|
||||
} from '@alfresco/js-api';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { of } from 'rxjs';
|
||||
import { ContentNodeSelectorPanelComponent } from './content-node-selector-panel.component';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
@@ -83,12 +82,14 @@ describe('ContentNodeSelectorPanelComponent', () => {
|
||||
component.queryBuilderService.executed.next(searchResults);
|
||||
};
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
});
|
||||
});
|
||||
|
||||
describe('General component features', () => {
|
||||
@@ -518,6 +519,7 @@ describe('ContentNodeSelectorPanelComponent', () => {
|
||||
expect(searchSpy.calls.count()).toBe(1, 'no other search has been performed');
|
||||
expect(component.clearSearch).toHaveBeenCalled();
|
||||
expect(component.folderIdToShow).toBe('cat-girl-nuku-nuku', 'back to the folder in which the search was performed');
|
||||
flush();
|
||||
}));
|
||||
|
||||
it('should folderIdToShow equal the folder node id when navigation changes', async () => {
|
||||
@@ -692,6 +694,7 @@ describe('ContentNodeSelectorPanelComponent', () => {
|
||||
fixture.detectChanges();
|
||||
|
||||
expect(component.folderIdToShow).toBe('cat-girl-nuku-nuku');
|
||||
flush();
|
||||
}));
|
||||
|
||||
it('should set the folderIdToShow to the default "currentFolderId" if siteId is undefined', (done) => {
|
||||
|
@@ -30,7 +30,6 @@ import {
|
||||
} from '@alfresco/js-api';
|
||||
import {
|
||||
AppConfigService,
|
||||
setupTestBed,
|
||||
DataRow,
|
||||
ThumbnailService,
|
||||
DataColumn
|
||||
@@ -90,12 +89,14 @@ describe('ContentNodeSelectorPanelComponent', () => {
|
||||
component.queryBuilderService.executed.next(searchResults);
|
||||
};
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
});
|
||||
});
|
||||
|
||||
describe('General component features', () => {
|
||||
|
@@ -18,20 +18,19 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { NameLocationCellComponent } from './name-location-cell.component';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { DataRow, setupTestBed } from '@alfresco/adf-core';
|
||||
import { DataRow } from '@alfresco/adf-core';
|
||||
|
||||
describe('NameLocationCellComponent', () => {
|
||||
let component: NameLocationCellComponent;
|
||||
let fixture: ComponentFixture<NameLocationCellComponent>;
|
||||
let rowData: DataRow;
|
||||
|
||||
setupTestBed({
|
||||
declarations: [
|
||||
NameLocationCellComponent
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [
|
||||
NameLocationCellComponent
|
||||
]
|
||||
});
|
||||
fixture = TestBed.createComponent(NameLocationCellComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
|
@@ -18,11 +18,7 @@
|
||||
import { TestBed, fakeAsync, ComponentFixture, tick } from '@angular/core/testing';
|
||||
import { MatDialogRef, MAT_DIALOG_DATA, MatDialog } from '@angular/material/dialog';
|
||||
import { of } from 'rxjs';
|
||||
import {
|
||||
setupTestBed,
|
||||
NotificationService,
|
||||
AppConfigService
|
||||
} from '@alfresco/adf-core';
|
||||
import { NotificationService, AppConfigService } from '@alfresco/adf-core';
|
||||
import { NodesApiService } from '../common/services/nodes-api.service';
|
||||
import { RenditionService } from '../common/services/rendition.service';
|
||||
|
||||
@@ -52,24 +48,23 @@ describe('ShareDialogComponent', () => {
|
||||
const clickShareToggleButton = () => fixture.nativeElement.querySelector(`${shareToggleId} label`)
|
||||
.dispatchEvent(new MouseEvent('click'));
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
providers: [
|
||||
{provide: NotificationService, useValue: notificationServiceMock},
|
||||
{
|
||||
provide: MatDialogRef, useValue: {
|
||||
close: () => {
|
||||
}
|
||||
}
|
||||
},
|
||||
{provide: MAT_DIALOG_DATA, useValue: {}}
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
providers: [
|
||||
{provide: NotificationService, useValue: notificationServiceMock},
|
||||
{
|
||||
provide: MatDialogRef, useValue: {
|
||||
close: () => {
|
||||
}
|
||||
}
|
||||
},
|
||||
{provide: MAT_DIALOG_DATA, useValue: {}}
|
||||
]
|
||||
});
|
||||
fixture = TestBed.createComponent(ShareDialogComponent);
|
||||
component = fixture.componentInstance;
|
||||
component.maxDebounceTime = 0;
|
||||
|
@@ -20,7 +20,7 @@ import { By } from '@angular/platform-browser';
|
||||
import { Component } from '@angular/core';
|
||||
import { DOCUMENT } from '@angular/common';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
import { setupTestBed, CoreModule } from '@alfresco/adf-core';
|
||||
import { CoreModule } from '@alfresco/adf-core';
|
||||
import { ContentNodeShareModule } from './content-node-share.module';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
@@ -50,19 +50,18 @@ describe('NodeSharedDirective', () => {
|
||||
let shareButtonElement;
|
||||
let selection;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
CoreModule.forRoot(),
|
||||
ContentTestingModule,
|
||||
ContentNodeShareModule
|
||||
],
|
||||
declarations: [
|
||||
NodeShareTestComponent
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
CoreModule.forRoot(),
|
||||
ContentTestingModule,
|
||||
ContentNodeShareModule
|
||||
],
|
||||
declarations: [
|
||||
NodeShareTestComponent
|
||||
]
|
||||
});
|
||||
fixture = TestBed.createComponent(NodeShareTestComponent);
|
||||
document = TestBed.inject(DOCUMENT);
|
||||
component = fixture.componentInstance;
|
||||
|
@@ -15,13 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
CoreTestingModule,
|
||||
IdentityUserModel,
|
||||
InitialUsernamePipe,
|
||||
setupTestBed,
|
||||
UserInfoMode
|
||||
} from '@alfresco/adf-core';
|
||||
import { CoreTestingModule, IdentityUserModel, InitialUsernamePipe, UserInfoMode } from '@alfresco/adf-core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { MatMenuModule } from '@angular/material/menu';
|
||||
import { By, DomSanitizer } from '@angular/platform-browser';
|
||||
@@ -85,16 +79,15 @@ describe('ContentUserInfoComponent', () => {
|
||||
fixture.detectChanges();
|
||||
};
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
CoreTestingModule,
|
||||
ContentTestingModule,
|
||||
MatMenuModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
CoreTestingModule,
|
||||
ContentTestingModule,
|
||||
MatMenuModule
|
||||
]
|
||||
});
|
||||
fixture = TestBed.createComponent(ContentUserInfoComponent);
|
||||
component = fixture.componentInstance;
|
||||
element = fixture.nativeElement;
|
||||
|
@@ -17,7 +17,6 @@
|
||||
|
||||
import { TestBed, ComponentFixture } from '@angular/core/testing';
|
||||
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { ConfirmDialogComponent } from './confirm.dialog';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
import { By } from '@angular/platform-browser';
|
||||
@@ -38,18 +37,17 @@ describe('Confirm Dialog Component', () => {
|
||||
noLabel: 'MAYBE NO'
|
||||
};
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
providers: [
|
||||
{ provide: MatDialogRef, useValue: dialogRef },
|
||||
{ provide: MAT_DIALOG_DATA, useValue: data }
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
providers: [
|
||||
{ provide: MatDialogRef, useValue: dialogRef },
|
||||
{ provide: MAT_DIALOG_DATA, useValue: data }
|
||||
]
|
||||
});
|
||||
dialogRef.close.calls.reset();
|
||||
fixture = TestBed.createComponent(ConfirmDialogComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
@@ -18,7 +18,7 @@
|
||||
import { TestBed, ComponentFixture } from '@angular/core/testing';
|
||||
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||
import { DownloadZipDialogComponent } from './download-zip.dialog';
|
||||
import { CoreTestingModule, setupTestBed } from '@alfresco/adf-core';
|
||||
import { CoreTestingModule } from '@alfresco/adf-core';
|
||||
import { DownloadZipService } from './services/download-zip.service';
|
||||
import { Observable } from 'rxjs';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
@@ -39,18 +39,17 @@ describe('DownloadZipDialogComponent', () => {
|
||||
]
|
||||
};
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
CoreTestingModule
|
||||
],
|
||||
providers: [
|
||||
{ provide: MatDialogRef, useValue: dialogRef },
|
||||
{ provide: MAT_DIALOG_DATA, useValue: dataMock }
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
CoreTestingModule
|
||||
],
|
||||
providers: [
|
||||
{ provide: MatDialogRef, useValue: dialogRef },
|
||||
{ provide: MAT_DIALOG_DATA, useValue: dataMock }
|
||||
]
|
||||
});
|
||||
dialogRef.close.calls.reset();
|
||||
fixture = TestBed.createComponent(DownloadZipDialogComponent);
|
||||
downloadZipService = TestBed.inject(DownloadZipService);
|
||||
|
@@ -17,7 +17,6 @@
|
||||
|
||||
import { TestBed, ComponentFixture } from '@angular/core/testing';
|
||||
import { MatDialogRef } from '@angular/material/dialog';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { NodesApiService } from '../common/services/nodes-api.service';
|
||||
|
||||
import { FolderDialogComponent } from './folder.dialog';
|
||||
@@ -34,17 +33,16 @@ describe('FolderDialogComponent', () => {
|
||||
close: jasmine.createSpy('close')
|
||||
};
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
providers: [
|
||||
{ provide: MatDialogRef, useValue: dialogRef }
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
providers: [
|
||||
{ provide: MatDialogRef, useValue: dialogRef }
|
||||
]
|
||||
});
|
||||
dialogRef.close.calls.reset();
|
||||
fixture = TestBed.createComponent(FolderDialogComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
@@ -19,7 +19,6 @@ import { LibraryDialogComponent } from './library.dialog';
|
||||
import { TestBed, fakeAsync, tick, flush, ComponentFixture, flushMicrotasks } from '@angular/core/testing';
|
||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { MatDialogRef } from '@angular/material/dialog';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { of, throwError } from 'rxjs';
|
||||
@@ -37,18 +36,17 @@ describe('LibraryDialogComponent', () => {
|
||||
close: jasmine.createSpy('close')
|
||||
};
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
providers: [
|
||||
{ provide: MatDialogRef, useValue: dialogRef }
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
providers: [
|
||||
{ provide: MatDialogRef, useValue: dialogRef }
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
});
|
||||
fixture = TestBed.createComponent(LibraryDialogComponent);
|
||||
component = fixture.componentInstance;
|
||||
sitesService = TestBed.inject(SitesService);
|
||||
|
@@ -19,7 +19,6 @@ import moment from 'moment';
|
||||
|
||||
import { TestBed, fakeAsync, tick, ComponentFixture } from '@angular/core/testing';
|
||||
import { MatDialogRef } from '@angular/material/dialog';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { NodeLockDialogComponent } from './node-lock.dialog';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
@@ -33,17 +32,16 @@ describe('NodeLockDialogComponent', () => {
|
||||
close: jasmine.createSpy('close')
|
||||
};
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
providers: [
|
||||
{ provide: MatDialogRef, useValue: dialogRef }
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
providers: [
|
||||
{ provide: MatDialogRef, useValue: dialogRef }
|
||||
]
|
||||
});
|
||||
fixture = TestBed.createComponent(NodeLockDialogComponent);
|
||||
component = fixture.componentInstance;
|
||||
});
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { ChangeDetectorRef, Component, ElementRef, SimpleChange } from '@angular/core';
|
||||
import { CoreTestingModule, setupTestBed } from '@alfresco/adf-core';
|
||||
import { CoreTestingModule } from '@alfresco/adf-core';
|
||||
import { ContentService } from '../common/services/content.service';
|
||||
import { CheckAllowableOperationDirective } from './check-allowable-operation.directive';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
@@ -32,17 +32,15 @@ class TestComponent implements NodeAllowableOperationSubject {
|
||||
}
|
||||
|
||||
describe('CheckAllowableOperationDirective', () => {
|
||||
|
||||
let changeDetectorMock: ChangeDetectorRef;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
CoreTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
CoreTestingModule
|
||||
]
|
||||
});
|
||||
changeDetectorMock = { detectChanges: () => {} } as ChangeDetectorRef;
|
||||
});
|
||||
|
||||
|
@@ -19,7 +19,7 @@ import { Component, DebugElement, ViewChild } from '@angular/core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { NodeDeleteDirective } from './node-delete.directive';
|
||||
import { setupTestBed, CoreTestingModule } from '@alfresco/adf-core';
|
||||
import { CoreTestingModule } from '@alfresco/adf-core';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { ContentDirectiveModule } from './content-directive.module';
|
||||
|
||||
@@ -88,20 +88,19 @@ describe('NodeDeleteDirective', () => {
|
||||
let deleteNodePermanentSpy: any;
|
||||
let purgeDeletedNodePermanentSpy: any;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
CoreTestingModule,
|
||||
ContentDirectiveModule
|
||||
],
|
||||
declarations: [
|
||||
TestComponent,
|
||||
TestWithPermissionsComponent,
|
||||
TestDeletePermanentComponent
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
CoreTestingModule,
|
||||
ContentDirectiveModule
|
||||
],
|
||||
declarations: [
|
||||
TestComponent,
|
||||
TestWithPermissionsComponent,
|
||||
TestDeletePermanentComponent
|
||||
]
|
||||
});
|
||||
fixture = TestBed.createComponent(TestComponent);
|
||||
fixtureWithPermissions = TestBed.createComponent(TestWithPermissionsComponent);
|
||||
fixtureWithPermanentComponent = TestBed.createComponent(TestDeletePermanentComponent);
|
||||
|
@@ -19,7 +19,7 @@ import { TestBed, ComponentFixture } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { Component, DebugElement, ViewChild } from '@angular/core';
|
||||
import { setupTestBed, AlfrescoApiService, CoreTestingModule } from '@alfresco/adf-core';
|
||||
import { AlfrescoApiService, CoreTestingModule } from '@alfresco/adf-core';
|
||||
import { NodeDownloadDirective } from './node-download.directive';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { ContentDirectiveModule } from '@alfresco/adf-content-services';
|
||||
@@ -51,18 +51,17 @@ describe('NodeDownloadDirective', () => {
|
||||
reply: jasmine.createSpy('reply')
|
||||
};
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
ContentDirectiveModule,
|
||||
TranslateModule.forRoot(),
|
||||
CoreTestingModule
|
||||
],
|
||||
declarations: [
|
||||
TestComponent
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
ContentDirectiveModule,
|
||||
TranslateModule.forRoot(),
|
||||
CoreTestingModule
|
||||
],
|
||||
declarations: [
|
||||
TestComponent
|
||||
]
|
||||
});
|
||||
fixture = TestBed.createComponent(TestComponent);
|
||||
component = fixture.componentInstance;
|
||||
element = fixture.debugElement.query(By.directive(NodeDownloadDirective));
|
||||
|
@@ -19,21 +19,20 @@ import { SimpleChange } from '@angular/core';
|
||||
import { fakeAsync, TestBed, tick } from '@angular/core/testing';
|
||||
import { NodeFavoriteDirective } from './node-favorite.directive';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { AlfrescoApiService, CoreTestingModule, setupTestBed } from '@alfresco/adf-core';
|
||||
import { AlfrescoApiService, CoreTestingModule } from '@alfresco/adf-core';
|
||||
|
||||
describe('NodeFavoriteDirective', () => {
|
||||
|
||||
let directive: NodeFavoriteDirective;
|
||||
let alfrescoApiService: AlfrescoApiService;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
CoreTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
CoreTestingModule
|
||||
]
|
||||
});
|
||||
alfrescoApiService = TestBed.inject(AlfrescoApiService);
|
||||
directive = new NodeFavoriteDirective( alfrescoApiService);
|
||||
});
|
||||
|
@@ -18,11 +18,9 @@
|
||||
import { TestBed, ComponentFixture, fakeAsync } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
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 { setupTestBed } from '@alfresco/adf-core';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
@@ -45,17 +43,16 @@ describe('NodeLock Directive', () => {
|
||||
let element: DebugElement;
|
||||
let contentNodeDialogService: ContentNodeDialogService;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
declarations: [
|
||||
TestComponent
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
declarations: [
|
||||
TestComponent
|
||||
]
|
||||
});
|
||||
fixture = TestBed.createComponent(TestComponent);
|
||||
component = fixture.componentInstance;
|
||||
element = fixture.debugElement.query(By.directive(NodeLockDirective));
|
||||
|
@@ -20,7 +20,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { NodeRestoreDirective } from './node-restore.directive';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { TranslationService, setupTestBed, CoreTestingModule } from '@alfresco/adf-core';
|
||||
import { TranslationService, CoreTestingModule } from '@alfresco/adf-core';
|
||||
import { ContentDirectiveModule } from './content-directive.module';
|
||||
|
||||
@Component({
|
||||
@@ -44,18 +44,17 @@ describe('NodeRestoreDirective', () => {
|
||||
let restoreNodeSpy: any;
|
||||
let translationService: TranslationService;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
CoreTestingModule,
|
||||
ContentDirectiveModule
|
||||
],
|
||||
declarations: [
|
||||
TestComponent
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
CoreTestingModule,
|
||||
ContentDirectiveModule
|
||||
],
|
||||
declarations: [
|
||||
TestComponent
|
||||
]
|
||||
});
|
||||
fixture = TestBed.createComponent(TestComponent);
|
||||
component = fixture.componentInstance;
|
||||
element = fixture.debugElement.query(By.directive(NodeRestoreDirective));
|
||||
|
@@ -17,7 +17,6 @@
|
||||
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { ContentActionModel } from './../../models/content-action.model';
|
||||
import { DocumentListComponent } from './../document-list.component';
|
||||
import { ContentActionListComponent } from './content-action-list.component';
|
||||
@@ -29,15 +28,14 @@ describe('ContentColumnList', () => {
|
||||
let documentList: DocumentListComponent;
|
||||
let actionList: ContentActionListComponent;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
});
|
||||
documentList = (TestBed.createComponent(DocumentListComponent).componentInstance as DocumentListComponent);
|
||||
actionList = new ContentActionListComponent(documentList);
|
||||
});
|
||||
|
@@ -17,7 +17,6 @@
|
||||
|
||||
import { CUSTOM_ELEMENTS_SCHEMA, SimpleChange, EventEmitter } from '@angular/core';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { FileNode } from '../../../mock';
|
||||
import { ContentActionModel } from './../../models/content-action.model';
|
||||
import { DocumentActionsService } from './../../services/document-actions.service';
|
||||
@@ -39,15 +38,14 @@ describe('ContentAction', () => {
|
||||
let contentService: ContentService;
|
||||
let nodeActionsService: NodeActionsService;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
});
|
||||
contentService = TestBed.inject(ContentService);
|
||||
nodeActionsService = new NodeActionsService(null, null, null);
|
||||
documentActions = new DocumentActionsService(nodeActionsService, null, null, null);
|
||||
|
@@ -18,7 +18,6 @@
|
||||
import { CUSTOM_ELEMENTS_SCHEMA, SimpleChange, QueryList, Component, ViewChild, SimpleChanges } from '@angular/core';
|
||||
import { ComponentFixture, TestBed, fakeAsync, tick } from '@angular/core/testing';
|
||||
import {
|
||||
setupTestBed,
|
||||
AlfrescoApiService,
|
||||
DataColumnListComponent,
|
||||
DataColumnComponent,
|
||||
@@ -86,18 +85,17 @@ describe('DocumentList', () => {
|
||||
let spyFolder: any;
|
||||
let spyFolderNode: any;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
providers: [
|
||||
{ provide: MatDialog, useValue: mockDialog }
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
providers: [
|
||||
{ provide: MatDialog, useValue: mockDialog }
|
||||
]
|
||||
});
|
||||
eventMock = {
|
||||
preventDefault: () => {}
|
||||
};
|
||||
@@ -1839,17 +1837,16 @@ describe('DocumentListComponent rendering', () => {
|
||||
let component: CustomTemplateComponent;
|
||||
let element: HTMLElement;
|
||||
|
||||
setupTestBed({
|
||||
declarations: [CustomTemplateComponent],
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule,
|
||||
DataTableModule,
|
||||
DocumentListModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [CustomTemplateComponent],
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule,
|
||||
DataTableModule,
|
||||
DocumentListModule
|
||||
]
|
||||
});
|
||||
fixture = TestBed.createComponent(CustomTemplateComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
|
@@ -18,7 +18,7 @@
|
||||
import { Subject, BehaviorSubject } from 'rxjs';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { setupTestBed, DataTableComponent, DataSorting } from '@alfresco/adf-core';
|
||||
import { DataTableComponent, DataSorting } from '@alfresco/adf-core';
|
||||
import { SearchService } from '../../../search/services/search.service';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { SimpleChange } from '@angular/core';
|
||||
@@ -48,21 +48,20 @@ describe('FilterHeaderComponent', () => {
|
||||
reload: () => jasmine.createSpy('reload')
|
||||
};
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
providers: [
|
||||
{ provide: ADF_DOCUMENT_PARENT_COMPONENT, useExisting: DocumentListComponent },
|
||||
{ provide: SearchService, useValue: searchMock },
|
||||
{ provide: SEARCH_QUERY_SERVICE_TOKEN, useClass: SearchHeaderQueryBuilderService },
|
||||
{ provide: DocumentListComponent, useValue: documentListMock },
|
||||
DataTableComponent
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
providers: [
|
||||
{ provide: ADF_DOCUMENT_PARENT_COMPONENT, useExisting: DocumentListComponent },
|
||||
{ provide: SearchService, useValue: searchMock },
|
||||
{ provide: SEARCH_QUERY_SERVICE_TOKEN, useClass: SearchHeaderQueryBuilderService },
|
||||
{ provide: DocumentListComponent, useValue: documentListMock },
|
||||
DataTableComponent
|
||||
]
|
||||
});
|
||||
fixture = TestBed.createComponent(FilterHeaderComponent);
|
||||
component = fixture.componentInstance;
|
||||
queryBuilder = fixture.componentInstance['searchFilterQueryBuilder'];
|
||||
|
@@ -17,7 +17,6 @@
|
||||
|
||||
import { TestBed, ComponentFixture } from '@angular/core/testing';
|
||||
import { NO_ERRORS_SCHEMA, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { LibraryNameColumnComponent } from './library-name-column.component';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
@@ -27,24 +26,20 @@ describe('LibraryNameColumnComponent', () => {
|
||||
let component: LibraryNameColumnComponent;
|
||||
let node;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA]
|
||||
});
|
||||
node = {
|
||||
id: 'nodeId',
|
||||
path: {
|
||||
elements: []
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(LibraryNameColumnComponent);
|
||||
component = fixture.componentInstance;
|
||||
});
|
||||
|
@@ -15,7 +15,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { LibraryRoleColumnComponent } from './library-role-column.component';
|
||||
import { TestBed, ComponentFixture } from '@angular/core/testing';
|
||||
import { NO_ERRORS_SCHEMA, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
@@ -26,15 +25,14 @@ describe('LibraryRoleColumnComponent', () => {
|
||||
let fixture: ComponentFixture<LibraryRoleColumnComponent>;
|
||||
let component: LibraryRoleColumnComponent;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA]
|
||||
});
|
||||
fixture = TestBed.createComponent(LibraryRoleColumnComponent);
|
||||
component = fixture.componentInstance;
|
||||
});
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { DataColumn, DataRow, DataSorting, ThumbnailService, setupTestBed } from '@alfresco/adf-core';
|
||||
import { DataColumn, DataRow, DataSorting, ThumbnailService } from '@alfresco/adf-core';
|
||||
import { FileNode, FolderNode, SmartFolderNode, RuleFolderNode, LinkFolderNode } from './../../mock';
|
||||
import { ERR_OBJECT_NOT_FOUND, ShareDataRow } from './share-data-row.model';
|
||||
import { ERR_COL_NOT_FOUND, ERR_ROW_NOT_FOUND, ShareDataTableAdapter } from './share-datatable-adapter';
|
||||
@@ -29,14 +29,13 @@ describe('ShareDataTableAdapter', () => {
|
||||
let thumbnailService: ThumbnailService;
|
||||
let contentService: ContentService;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
const imageUrl: string = 'http://<addresss>';
|
||||
|
||||
contentService = TestBed.inject(ContentService);
|
||||
|
@@ -15,7 +15,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { FileNode, FolderNode } from '../../mock';
|
||||
import { ContentActionHandler } from '../models/content-action.model';
|
||||
import { DocumentActionsService } from './document-actions.service';
|
||||
@@ -30,14 +29,13 @@ describe('DocumentActionsService', () => {
|
||||
let service: DocumentActionsService;
|
||||
let documentListService: DocumentListService;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
documentListService = TestBed.inject(DocumentListService);
|
||||
service = TestBed.inject(DocumentActionsService);
|
||||
});
|
||||
|
@@ -15,7 +15,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { DocumentListService } from './document-list.service';
|
||||
import { fakeAsync, TestBed } from '@angular/core/testing';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
@@ -61,14 +60,13 @@ describe('DocumentListService', () => {
|
||||
}
|
||||
};
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
service = TestBed.inject(DocumentListService);
|
||||
jasmine.Ajax.install();
|
||||
});
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { AppConfigService, setupTestBed } from '@alfresco/adf-core';
|
||||
import { AppConfigService } from '@alfresco/adf-core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { FileNode, FolderNode } from '../../mock';
|
||||
import { ContentActionHandler } from '../models/content-action.model';
|
||||
@@ -30,14 +30,13 @@ describe('FolderActionsService', () => {
|
||||
let service: FolderActionsService;
|
||||
let documentListService: DocumentListService;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
const appConfig: AppConfigService = TestBed.inject(AppConfigService);
|
||||
appConfig.config.ecmHost = 'http://localhost:9876/ecm';
|
||||
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { LockService } from './lock.service';
|
||||
import { CoreTestingModule, setupTestBed, AlfrescoApiService } from '@alfresco/adf-core';
|
||||
import { CoreTestingModule, AlfrescoApiService } from '@alfresco/adf-core';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
import moment from 'moment';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
@@ -31,14 +31,13 @@ describe('PeopleProcessService', () => {
|
||||
const fakeFolderNode: Node = { name: 'unlocked', isLocked: false, isFile: false, isFolder: true } as Node;
|
||||
const fakeNodeNoProperty: Node = { name: 'unlocked', isLocked: true, isFile: true, properties: {} } as Node;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
CoreTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
CoreTestingModule
|
||||
]
|
||||
});
|
||||
service = TestBed.inject(LockService);
|
||||
apiService = TestBed.inject(AlfrescoApiService);
|
||||
});
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { fakeAsync, TestBed, tick } from '@angular/core/testing';
|
||||
import { Node, NodeEntry } from '@alfresco/js-api';
|
||||
import { AppConfigService, setupTestBed } from '@alfresco/adf-core';
|
||||
import { AppConfigService } 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';
|
||||
@@ -40,17 +40,16 @@ describe('NodeActionsService', () => {
|
||||
open: jasmine.createSpy('open')
|
||||
};
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
providers: [
|
||||
{ provide: MatDialogRef, useValue: dialogRef }
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
providers: [
|
||||
{ provide: MatDialogRef, useValue: dialogRef }
|
||||
]
|
||||
});
|
||||
const appConfig: AppConfigService = TestBed.inject(AppConfigService);
|
||||
appConfig.config.ecmHost = 'http://localhost:9876/ecm';
|
||||
|
||||
|
@@ -20,8 +20,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { Subject, of } from 'rxjs';
|
||||
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { FolderCreateDirective } from './folder-create.directive';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
@@ -63,25 +61,22 @@ describe('FolderCreateDirective', () => {
|
||||
|
||||
const event = { type: 'click', preventDefault: () => null };
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
declarations: [
|
||||
TestTypeComponent,
|
||||
TestComponent
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
declarations: [
|
||||
TestTypeComponent,
|
||||
TestComponent
|
||||
]
|
||||
});
|
||||
fixture = TestBed.createComponent(TestComponent);
|
||||
element = fixture.debugElement.query(By.directive(FolderCreateDirective));
|
||||
dialog = TestBed.inject(MatDialog);
|
||||
contentService = TestBed.inject(ContentService);
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
dialogRefMock = {
|
||||
afterClosed: (val) => of(val),
|
||||
componentInstance: {
|
||||
@@ -92,7 +87,6 @@ describe('FolderCreateDirective', () => {
|
||||
});
|
||||
|
||||
describe('With overrides', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(TestTypeComponent);
|
||||
element = fixture.debugElement.query(By.directive(FolderCreateDirective));
|
||||
|
@@ -20,8 +20,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { Subject, of } from 'rxjs';
|
||||
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { FolderEditDirective } from './folder-edit.directive';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
@@ -52,24 +50,21 @@ describe('FolderEditDirective', () => {
|
||||
preventDefault: () => null
|
||||
};
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
declarations: [
|
||||
TestComponent
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
declarations: [
|
||||
TestComponent
|
||||
]
|
||||
});
|
||||
fixture = TestBed.createComponent(TestComponent);
|
||||
element = fixture.debugElement.query(By.directive(FolderEditDirective));
|
||||
dialog = TestBed.inject(MatDialog);
|
||||
contentService = TestBed.inject(ContentService);
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
dialogRefMock = {
|
||||
afterClosed: (val) => of(val),
|
||||
componentInstance: {
|
||||
|
@@ -18,7 +18,6 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { mockFile, mockNode } from '../mock';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
import { UploadVersionButtonComponent } from '../upload';
|
||||
@@ -44,27 +43,26 @@ describe('NewVersionUploaderDialog', () => {
|
||||
};
|
||||
const showVersionsOnly = true;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
declarations: [
|
||||
NewVersionUploaderDialogComponent,
|
||||
VersionListComponent,
|
||||
VersionUploadComponent,
|
||||
UploadVersionButtonComponent,
|
||||
VersionComparisonComponent
|
||||
],
|
||||
providers: [
|
||||
{ provide: MAT_DIALOG_DATA, useValue: { node: mockNode, showVersionsOnly, file: mockFile } },
|
||||
{
|
||||
provide: MatDialogRef, useValue: mockDialogRef
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
declarations: [
|
||||
NewVersionUploaderDialogComponent,
|
||||
VersionListComponent,
|
||||
VersionUploadComponent,
|
||||
UploadVersionButtonComponent,
|
||||
VersionComparisonComponent
|
||||
],
|
||||
providers: [
|
||||
{ provide: MAT_DIALOG_DATA, useValue: { node: mockNode, showVersionsOnly, file: mockFile } },
|
||||
{
|
||||
provide: MatDialogRef, useValue: mockDialogRef
|
||||
}
|
||||
]
|
||||
});
|
||||
fixture = TestBed.createComponent(NewVersionUploaderDialogComponent);
|
||||
component = fixture.componentInstance;
|
||||
nativeElement = fixture.debugElement.nativeElement;
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { CommentModel, setupTestBed, CoreTestingModule } from '@alfresco/adf-core';
|
||||
import { CommentModel, CoreTestingModule } from '@alfresco/adf-core';
|
||||
import { fakeContentComment, fakeContentComments } from '../mocks/node-comments.mock';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { NodeCommentsService } from './node-comments.service';
|
||||
@@ -27,14 +27,13 @@ describe('NodeCommentsService', () => {
|
||||
|
||||
let service: NodeCommentsService;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
CoreTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
CoreTestingModule
|
||||
]
|
||||
});
|
||||
service = TestBed.inject(NodeCommentsService);
|
||||
|
||||
jasmine.Ajax.install();
|
||||
|
@@ -15,7 +15,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { Node, PermissionElement } from '@alfresco/js-api';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
@@ -60,18 +59,17 @@ describe('AddPermissionDialog', () => {
|
||||
close: jasmine.createSpy('close')
|
||||
};
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
providers: [
|
||||
{ provide: MatDialogRef, useValue: dialogRef },
|
||||
{ provide: MAT_DIALOG_DATA, useValue: data }
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
providers: [
|
||||
{ provide: MatDialogRef, useValue: dialogRef },
|
||||
{ provide: MAT_DIALOG_DATA, useValue: data }
|
||||
]
|
||||
});
|
||||
fixture = TestBed.createComponent(AddPermissionDialogComponent);
|
||||
component = fixture.componentInstance;
|
||||
element = fixture.nativeElement;
|
||||
|
@@ -18,7 +18,6 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { AddPermissionPanelComponent } from './add-permission-panel.component';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { of } from 'rxjs';
|
||||
import { fakeAuthorityListResult, fakeNameListResult } from '../../../mock/add-permission.component.mock';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
@@ -34,15 +33,14 @@ describe('AddPermissionPanelComponent', () => {
|
||||
let searchApiService: SearchService;
|
||||
let debugElement: DebugElement;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule,
|
||||
MatIconTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule,
|
||||
MatIconTestingModule
|
||||
]
|
||||
});
|
||||
fixture = TestBed.createComponent(AddPermissionPanelComponent);
|
||||
searchApiService = fixture.componentRef.injector.get(SearchService);
|
||||
|
||||
|
@@ -15,7 +15,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { AddPermissionComponent } from './add-permission.component';
|
||||
@@ -33,14 +32,13 @@ describe('AddPermissionComponent', () => {
|
||||
let element: HTMLElement;
|
||||
let nodePermissionService: NodePermissionService;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
nodePermissionService = TestBed.inject(NodePermissionService);
|
||||
const response: any = { node: { id: 'fake-node', allowableOperations: ['updatePermissions']}, roles: [{ label: 'Test' , role: 'test'}] };
|
||||
spyOn(nodePermissionService, 'getNodeWithRoles').and.returnValue(of(response));
|
||||
|
@@ -17,7 +17,6 @@
|
||||
|
||||
import { SimpleInheritedPermissionTestComponent } from '../../mock/inherited-permission.component.mock';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { of } from 'rxjs';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
@@ -34,17 +33,16 @@ describe('InheritPermissionDirective', () => {
|
||||
let component: SimpleInheritedPermissionTestComponent;
|
||||
let nodeService: NodesApiService;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
declarations: [
|
||||
SimpleInheritedPermissionTestComponent
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
declarations: [
|
||||
SimpleInheritedPermissionTestComponent
|
||||
]
|
||||
});
|
||||
fixture = TestBed.createComponent(SimpleInheritedPermissionTestComponent);
|
||||
component = fixture.componentInstance;
|
||||
element = fixture.nativeElement;
|
||||
|
@@ -15,7 +15,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
@@ -28,14 +27,13 @@ describe('PermissionContainerComponent', () => {
|
||||
let component: PermissionContainerComponent;
|
||||
let element: HTMLElement;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
fixture = TestBed.createComponent(PermissionContainerComponent);
|
||||
component = fixture.componentInstance;
|
||||
element = fixture.nativeElement;
|
||||
|
@@ -15,7 +15,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
@@ -50,14 +49,13 @@ describe('PermissionListComponent', () => {
|
||||
let searchQuerySpy: jasmine.Spy;
|
||||
const fakeLocalPermission = JSON.parse(JSON.stringify(fakeNodeWithOnlyLocally));
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
fixture = TestBed.createComponent(PermissionListComponent);
|
||||
component = fixture.componentInstance;
|
||||
element = fixture.nativeElement;
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { NotificationService, setupTestBed } from '@alfresco/adf-core';
|
||||
import { NotificationService } from '@alfresco/adf-core';
|
||||
import { NodesApiService } from '../../../common/services/nodes-api.service';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
@@ -38,14 +38,13 @@ describe('PermissionListService', () => {
|
||||
})
|
||||
];
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
service = TestBed.inject(PermissionListService);
|
||||
nodePermissionService = TestBed.inject(NodePermissionService);
|
||||
notificationService = TestBed.inject(NotificationService);
|
||||
|
@@ -15,7 +15,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
@@ -38,14 +37,13 @@ describe('UserIconColumnComponent', () => {
|
||||
displayName: 'fake authority'
|
||||
};
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
fixture = TestBed.createComponent(UserIconColumnComponent);
|
||||
component = fixture.componentInstance;
|
||||
element = fixture.nativeElement;
|
||||
|
@@ -15,7 +15,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
@@ -38,14 +37,13 @@ describe('UserNameColumnComponent', () => {
|
||||
displayName: 'fake authority'
|
||||
};
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
fixture = TestBed.createComponent(UserNameColumnComponent);
|
||||
component = fixture.componentInstance;
|
||||
element = fixture.nativeElement;
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { AppConfigService, setupTestBed } from '@alfresco/adf-core';
|
||||
import { AppConfigService } from '@alfresco/adf-core';
|
||||
import { NodePermissionDialogService } from './node-permission-dialog.service';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { of, Subject, throwError } from 'rxjs';
|
||||
@@ -33,14 +33,13 @@ describe('NodePermissionDialogService', () => {
|
||||
let afterOpenObservable: Subject<any>;
|
||||
let nodePermissionService: NodePermissionService;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
const appConfig: AppConfigService = TestBed.inject(AppConfigService);
|
||||
appConfig.config.ecmHost = 'http://localhost:9876/ecm';
|
||||
service = TestBed.inject(NodePermissionDialogService);
|
||||
|
@@ -17,7 +17,6 @@
|
||||
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { NodePermissionService } from './node-permission.service';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { SearchService } from '../../search/services/search.service';
|
||||
import { Node, PermissionElement } from '@alfresco/js-api';
|
||||
import { of, throwError } from 'rxjs';
|
||||
@@ -51,14 +50,13 @@ describe('NodePermissionService', () => {
|
||||
}
|
||||
];
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
service = TestBed.inject(NodePermissionService);
|
||||
searchApiService = TestBed.inject(SearchService);
|
||||
nodeService = TestBed.inject(NodesApiService);
|
||||
|
@@ -17,7 +17,6 @@
|
||||
|
||||
import { Component } from '@angular/core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { SearchFacetFiltersService } from '../services/search-facet-filters.service';
|
||||
@@ -34,15 +33,14 @@ describe('Directive: ResetSearchDirective', () => {
|
||||
let searchFacetFiltersService: SearchFacetFiltersService;
|
||||
let queryBuilder: SearchQueryBuilderService;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
declarations: [TestComponent]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
declarations: [TestComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(TestComponent);
|
||||
searchFacetFiltersService = TestBed.inject(SearchFacetFiltersService);
|
||||
queryBuilder = TestBed.inject(SearchQueryBuilderService);
|
||||
|
@@ -17,7 +17,6 @@
|
||||
|
||||
import { SearchCheckListComponent, SearchListOption } from './search-check-list.component';
|
||||
import { SearchFilterList } from '../../models/search-filter-list.model';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { sizeOptions, stepOne, stepThree } from '../../../mock';
|
||||
@@ -28,14 +27,13 @@ describe('SearchCheckListComponent', () => {
|
||||
let fixture: ComponentFixture<SearchCheckListComponent>;
|
||||
let component: SearchCheckListComponent;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
fixture = TestBed.createComponent(SearchCheckListComponent);
|
||||
component = fixture.componentInstance;
|
||||
});
|
||||
|
@@ -18,12 +18,7 @@
|
||||
import { Component, DebugElement, ViewChild } from '@angular/core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import {
|
||||
AuthenticationService,
|
||||
SearchTextInputComponent,
|
||||
setupTestBed,
|
||||
UserPreferencesService
|
||||
} from '@alfresco/adf-core';
|
||||
import { AuthenticationService, SearchTextInputComponent, UserPreferencesService } from '@alfresco/adf-core';
|
||||
import { noResult, results } from '../../mock';
|
||||
import { SearchControlComponent } from './search-control.component';
|
||||
import { SearchService } from '../services/search.service';
|
||||
@@ -64,17 +59,16 @@ describe('SearchControlComponent', () => {
|
||||
let searchServiceSpy: jasmine.Spy;
|
||||
let userPreferencesService: UserPreferencesService;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
declarations: [
|
||||
SimpleSearchTestCustomEmptyComponent
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
declarations: [
|
||||
SimpleSearchTestCustomEmptyComponent
|
||||
]
|
||||
});
|
||||
fixture = TestBed.createComponent(SearchControlComponent);
|
||||
debugElement = fixture.debugElement;
|
||||
searchService = TestBed.inject(SearchService);
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { SearchDateRangeComponent } from './search-date-range.component';
|
||||
import { MomentDateAdapter, setupTestBed } from '@alfresco/adf-core';
|
||||
import { MomentDateAdapter } from '@alfresco/adf-core';
|
||||
import { DateAdapter } from '@angular/material/core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
@@ -33,14 +33,13 @@ describe('SearchDateRangeComponent', () => {
|
||||
const maxDate = '10-Mar-20';
|
||||
const dateFormatFixture = 'DD-MMM-YY';
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
fixture = TestBed.createComponent(SearchDateRangeComponent);
|
||||
adapter = fixture.debugElement.injector.get(DateAdapter) as MomentDateAdapter;
|
||||
component = fixture.componentInstance;
|
||||
|
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
|
||||
import { SearchDatetimeRangeComponent } from './search-datetime-range.component';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
@@ -31,14 +30,13 @@ describe('SearchDatetimeRangeComponent', () => {
|
||||
const maxDatetime = '10-Mar-20 20:00';
|
||||
const datetimeFormatFixture = 'DD-MMM-YY HH:mm';
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
fixture = TestBed.createComponent(SearchDatetimeRangeComponent);
|
||||
component = fixture.componentInstance;
|
||||
});
|
||||
|
@@ -21,7 +21,6 @@ import { ContentTestingModule } from '../../../../testing/content.testing.module
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { SearchQueryBuilderService } from '../../../services/search-query-builder.service';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { SearchFilterList } from '../../../models/search-filter-list.model';
|
||||
|
||||
describe('SearchFacetChipComponent', () => {
|
||||
@@ -29,14 +28,13 @@ describe('SearchFacetChipComponent', () => {
|
||||
let fixture: ComponentFixture<SearchFacetChipComponent>;
|
||||
let queryBuilder: SearchQueryBuilderService;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
fixture = TestBed.createComponent(SearchFacetChipComponent);
|
||||
component = fixture.componentInstance;
|
||||
queryBuilder = TestBed.inject(SearchQueryBuilderService);
|
||||
|
@@ -19,20 +19,18 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { SearchFilterMenuCardComponent } from './search-filter-menu-card.component';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { ContentTestingModule } from '../../../../testing/content.testing.module';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
|
||||
describe('SearchFilterMenuComponent', () => {
|
||||
let component: SearchFilterMenuCardComponent;
|
||||
let fixture: ComponentFixture<SearchFilterMenuCardComponent>;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
fixture = TestBed.createComponent(SearchFilterMenuCardComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
|
@@ -18,7 +18,6 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { SearchWidgetChipComponent } from './search-widget-chip.component';
|
||||
import { simpleCategories } from '../../../../mock';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { ContentTestingModule } from '../../../../testing/content.testing.module';
|
||||
import { MatMenuModule } from '@angular/material/menu';
|
||||
@@ -30,22 +29,21 @@ describe('SearchWidgetChipComponent', () => {
|
||||
let fixture: ComponentFixture<SearchWidgetChipComponent>;
|
||||
let queryBuilder: SearchQueryBuilderService;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
MatMenuModule,
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
queryBuilder = TestBed.inject(SearchQueryBuilderService);
|
||||
fixture = TestBed.createComponent(SearchWidgetChipComponent);
|
||||
component = fixture.componentInstance;
|
||||
spyOn(queryBuilder, 'update').and.stub();
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
MatMenuModule,
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
queryBuilder = TestBed.inject(SearchQueryBuilderService);
|
||||
fixture = TestBed.createComponent(SearchWidgetChipComponent);
|
||||
component = fixture.componentInstance;
|
||||
spyOn(queryBuilder, 'update').and.stub();
|
||||
|
||||
component.category = simpleCategories[1];
|
||||
fixture.detectChanges();
|
||||
component.category = simpleCategories[1];
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should update search query on apply click', () => {
|
||||
|
@@ -18,7 +18,6 @@
|
||||
import { Subject } from 'rxjs';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { SearchService } from '../../services/search.service';
|
||||
import { SearchHeaderQueryBuilderService } from '../../services/search-header-query-builder.service';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
@@ -53,18 +52,17 @@ describe('SearchFilterContainerComponent', () => {
|
||||
dataLoaded: new Subject()
|
||||
};
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
providers: [
|
||||
{ provide: SearchService, useValue: searchMock },
|
||||
{ provide: SEARCH_QUERY_SERVICE_TOKEN, useClass: SearchHeaderQueryBuilderService }
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
providers: [
|
||||
{ provide: SearchService, useValue: searchMock },
|
||||
{ provide: SEARCH_QUERY_SERVICE_TOKEN, useClass: SearchHeaderQueryBuilderService }
|
||||
]
|
||||
});
|
||||
fixture = TestBed.createComponent(SearchFilterContainerComponent);
|
||||
component = fixture.componentInstance;
|
||||
queryBuilder = fixture.componentInstance['searchFilterQueryBuilder'];
|
||||
|
@@ -17,7 +17,6 @@
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { SearchFormComponent } from './search-form.component';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { SEARCH_QUERY_SERVICE_TOKEN } from '../../search-query-service.token';
|
||||
@@ -35,23 +34,22 @@ describe('SearchFormComponent', () => {
|
||||
{ default: false, index: 2, name: 'Second', selected: false }
|
||||
];
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
providers: [
|
||||
{ provide: SEARCH_QUERY_SERVICE_TOKEN, useClass: SearchQueryBuilderService }
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(SearchFormComponent);
|
||||
component = fixture.componentInstance;
|
||||
queryBuilder = TestBed.inject<SearchQueryBuilderService>(SEARCH_QUERY_SERVICE_TOKEN);
|
||||
queryBuilder.searchForms.next(mockSearchForms);
|
||||
fixture.detectChanges();
|
||||
});
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
providers: [
|
||||
{ provide: SEARCH_QUERY_SERVICE_TOKEN, useClass: SearchQueryBuilderService }
|
||||
]
|
||||
});
|
||||
fixture = TestBed.createComponent(SearchFormComponent);
|
||||
component = fixture.componentInstance;
|
||||
queryBuilder = TestBed.inject<SearchQueryBuilderService>(SEARCH_QUERY_SERVICE_TOKEN);
|
||||
queryBuilder.searchForms.next(mockSearchForms);
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should show search forms', () => {
|
||||
const title = fixture.debugElement.query(By.css('.adf-search-form-title'));
|
||||
|
@@ -17,7 +17,6 @@
|
||||
|
||||
import { SearchCheckListComponent, SearchListOption } from '../search-check-list/search-check-list.component';
|
||||
import { SearchFilterList } from '../../models/search-filter-list.model';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { sizeOptions, stepOne, stepThree } from '../../../mock';
|
||||
@@ -28,14 +27,13 @@ describe('SearchCheckListComponent', () => {
|
||||
let fixture: ComponentFixture<SearchCheckListComponent>;
|
||||
let component: SearchCheckListComponent;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
fixture = TestBed.createComponent(SearchCheckListComponent);
|
||||
component = fixture.componentInstance;
|
||||
});
|
||||
|
@@ -19,7 +19,6 @@ import { sizeOptions, stepOne, stepThree } from '../../../mock';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { SearchRadioComponent } from './search-radio.component';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
@@ -27,14 +26,13 @@ describe('SearchRadioComponent', () => {
|
||||
let fixture: ComponentFixture<SearchRadioComponent>;
|
||||
let component: SearchRadioComponent;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
fixture = TestBed.createComponent(SearchRadioComponent);
|
||||
component = fixture.componentInstance;
|
||||
});
|
||||
|
@@ -17,7 +17,6 @@
|
||||
|
||||
import { MatSliderChange } from '@angular/material/slider';
|
||||
import { SearchSliderComponent } from './search-slider.component';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
@@ -26,14 +25,13 @@ describe('SearchSliderComponent', () => {
|
||||
let fixture: ComponentFixture<SearchSliderComponent>;
|
||||
let component: SearchSliderComponent;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
fixture = TestBed.createComponent(SearchSliderComponent);
|
||||
component = fixture.componentInstance;
|
||||
});
|
||||
|
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
|
||||
import { SearchTextComponent } from './search-text.component';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
@@ -25,14 +24,13 @@ describe('SearchTextComponent', () => {
|
||||
let fixture: ComponentFixture<SearchTextComponent>;
|
||||
let component: SearchTextComponent;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
fixture = TestBed.createComponent(SearchTextComponent);
|
||||
component = fixture.componentInstance;
|
||||
component.id = 'text';
|
||||
|
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { SearchService } from '../services/search.service';
|
||||
import { differentResult, result, SimpleSearchTestComponent } from '../../mock';
|
||||
import { of, throwError } from 'rxjs';
|
||||
@@ -30,15 +29,14 @@ describe('SearchComponent', () => {
|
||||
let component: SimpleSearchTestComponent;
|
||||
let searchService: SearchService;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
declarations: [SimpleSearchTestComponent]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
declarations: [SimpleSearchTestComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(SimpleSearchTestComponent);
|
||||
component = fixture.componentInstance;
|
||||
element = fixture.nativeElement;
|
||||
|
@@ -18,22 +18,20 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { mockError, fakeSearch } from '../mocks/search.service.mock';
|
||||
import { SearchService } from './search.service';
|
||||
import { setupTestBed, CoreTestingModule } from '@alfresco/adf-core';
|
||||
import { CoreTestingModule } from '@alfresco/adf-core';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { NodePaging } from '@alfresco/js-api';
|
||||
|
||||
describe('SearchService', () => {
|
||||
|
||||
let service: SearchService;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
CoreTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
CoreTestingModule
|
||||
]
|
||||
});
|
||||
service = TestBed.inject(SearchService);
|
||||
});
|
||||
|
||||
|
@@ -19,7 +19,7 @@ import { DebugElement } from '@angular/core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { DropdownSitesComponent, Relations } from './sites-dropdown.component';
|
||||
import { AuthenticationService, setupTestBed } from '@alfresco/adf-core';
|
||||
import { AuthenticationService } from '@alfresco/adf-core';
|
||||
import { of } from 'rxjs';
|
||||
import { getFakeSitePaging,
|
||||
getFakeSitePagingNoMoreItems,
|
||||
@@ -59,11 +59,13 @@ describe('DropdownSitesComponent', () => {
|
||||
let siteService: SitesService;
|
||||
let authService: AuthenticationService;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
});
|
||||
|
||||
describe('Rendering tests', () => {
|
||||
|
@@ -17,8 +17,6 @@
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { LikeComponent } from './like.component';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
import { of } from 'rxjs';
|
||||
import { RatingService } from './services/rating.service';
|
||||
@@ -31,14 +29,13 @@ describe('Like component', () => {
|
||||
let element: HTMLElement;
|
||||
let service: RatingService;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
service = TestBed.inject(RatingService);
|
||||
|
||||
spyOn(service, 'getRating').and.returnValue(of({
|
||||
|
@@ -17,8 +17,6 @@
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { RatingComponent } from './rating.component';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
import { of } from 'rxjs';
|
||||
import { RatingService } from './services/rating.service';
|
||||
@@ -31,14 +29,13 @@ describe('Rating component', () => {
|
||||
let element: HTMLElement;
|
||||
let service: RatingService;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
fixture = TestBed.createComponent(RatingComponent);
|
||||
service = TestBed.inject(RatingService);
|
||||
|
||||
|
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { RatingService } from './rating.service';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
@@ -25,17 +24,15 @@ import { ratingOneMock, ratingThreeMock } from '../mock/rating-response.mock';
|
||||
declare let jasmine: any;
|
||||
|
||||
describe('Rating service', () => {
|
||||
|
||||
let service;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
let service: RatingService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
service = TestBed.inject(RatingService);
|
||||
});
|
||||
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { LogService, setupTestBed, UserPreferencesService } from '@alfresco/adf-core';
|
||||
import { LogService, UserPreferencesService } from '@alfresco/adf-core';
|
||||
import { TagService } from './tag.service';
|
||||
import { fakeAsync, TestBed, tick } from '@angular/core/testing';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
@@ -41,14 +41,13 @@ describe('TagService', () => {
|
||||
return tagPaging;
|
||||
};
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
service = TestBed.inject(TagService);
|
||||
logService = TestBed.inject(LogService);
|
||||
userPreferencesService = TestBed.inject(UserPreferencesService);
|
||||
|
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { TagActionsComponent } from './tag-actions.component';
|
||||
import { TagService } from './services/tag.service';
|
||||
import { of } from 'rxjs';
|
||||
@@ -47,14 +46,13 @@ describe('TagActionsComponent', () => {
|
||||
let element: HTMLElement;
|
||||
let tagService: TagService;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
fixture = TestBed.createComponent(TagActionsComponent);
|
||||
tagService = TestBed.inject(TagService);
|
||||
spyOn(tagService, 'getTagsByNodeId').and.returnValue(of(dataTag));
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { AppConfigService, setupTestBed } from '@alfresco/adf-core';
|
||||
import { AppConfigService } from '@alfresco/adf-core';
|
||||
import { TagService } from './services/tag.service';
|
||||
import { TagListComponent } from '././tag-list.component';
|
||||
import { of } from 'rxjs';
|
||||
@@ -47,14 +47,13 @@ describe('TagList', () => {
|
||||
let element: HTMLElement;
|
||||
let tagService: TagService;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
const appConfig: AppConfigService = TestBed.inject(AppConfigService);
|
||||
appConfig.config.ecmHost = 'http://localhost:9876/ecm';
|
||||
|
||||
|
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { TagNodeListComponent } from './tag-node-list.component';
|
||||
import { TagService } from './services/tag.service';
|
||||
import { of } from 'rxjs';
|
||||
@@ -66,14 +65,13 @@ describe('TagNodeList', () => {
|
||||
return element.querySelectorAll('.adf-tag-chips');
|
||||
}
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
const resizeObserverSpy = spyOn(window, 'ResizeObserver').and.callThrough();
|
||||
fixture = TestBed.createComponent(TagNodeListComponent);
|
||||
|
||||
|
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { TreeViewComponent } from './tree-view.component';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { TreeViewService } from '../services/tree-view.service';
|
||||
@@ -72,11 +71,13 @@ describe('TreeViewComponent', () => {
|
||||
}
|
||||
};
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
});
|
||||
|
||||
describe('When there is a nodeId', () => {
|
||||
|
@@ -15,7 +15,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { NodesApiService } from '../../common/services/nodes-api.service';
|
||||
import { TreeViewService } from './tree-view.service';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
@@ -39,14 +38,13 @@ describe('TreeViewService', () => {
|
||||
{ entry: { id: 'fake-file-id', name: 'fake-file-name', isFolder: false } }
|
||||
] } });
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
service = TestBed.inject(TreeViewService);
|
||||
nodeService = TestBed.inject(NodesApiService);
|
||||
});
|
||||
|
@@ -17,7 +17,6 @@
|
||||
|
||||
import { Component } from '@angular/core';
|
||||
import { ComponentFixture, TestBed, fakeAsync, tick } from '@angular/core/testing';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { UploadBase } from './upload-base';
|
||||
import { UploadFilesEvent } from '../upload-files.event';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
@@ -42,17 +41,16 @@ describe('UploadBase', () => {
|
||||
let fixture: ComponentFixture<UploadTestComponent>;
|
||||
let uploadService: UploadService;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
declarations: [
|
||||
UploadTestComponent
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
declarations: [
|
||||
UploadTestComponent
|
||||
]
|
||||
});
|
||||
fixture = TestBed.createComponent(UploadTestComponent);
|
||||
uploadService = TestBed.inject(UploadService);
|
||||
|
||||
|
@@ -17,9 +17,7 @@
|
||||
|
||||
import { EventEmitter } from '@angular/core';
|
||||
import { ComponentFixture, TestBed, fakeAsync, tick } from '@angular/core/testing';
|
||||
import {
|
||||
setupTestBed, UserPreferencesService
|
||||
} from '@alfresco/adf-core';
|
||||
import { UserPreferencesService } from '@alfresco/adf-core';
|
||||
import { UploadModule } from '../upload.module';
|
||||
import { FileUploadingDialogComponent } from './file-uploading-dialog.component';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
@@ -36,15 +34,14 @@ describe('FileUploadingDialogComponent', () => {
|
||||
let emitter: EventEmitter<any>;
|
||||
let fileList: FileModel[];
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule,
|
||||
UploadModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule,
|
||||
UploadModule
|
||||
]
|
||||
});
|
||||
fixture = TestBed.createComponent(FileUploadingDialogComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
|
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { FileUploadingListRowComponent } from './file-uploading-list-row.component';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
@@ -28,14 +27,13 @@ describe('FileUploadingListRowComponent', () => {
|
||||
let component: FileUploadingListRowComponent;
|
||||
const file = new FileModel({ name: 'fake-name' } as File);
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
fixture = TestBed.createComponent(FileUploadingListRowComponent);
|
||||
component = fixture.componentInstance;
|
||||
});
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { TranslationService, setupTestBed } from '@alfresco/adf-core';
|
||||
import { TranslationService } from '@alfresco/adf-core';
|
||||
import { of } from 'rxjs';
|
||||
import { FileUploadingListComponent } from './file-uploading-list.component';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
@@ -37,14 +37,13 @@ describe('FileUploadingListComponent', () => {
|
||||
file = { data: { entry: { id: 'x' } } };
|
||||
});
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
nodesApiService = TestBed.inject(NodesApiService);
|
||||
|
||||
uploadService = TestBed.inject(UploadService);
|
||||
|
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { UploadDragAreaComponent } from './upload-drag-area.component';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
@@ -105,14 +104,13 @@ describe('UploadDragAreaComponent', () => {
|
||||
let fixture: ComponentFixture<UploadDragAreaComponent>;
|
||||
let uploadService: UploadService;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
]
|
||||
});
|
||||
fixture = TestBed.createComponent(UploadDragAreaComponent);
|
||||
uploadService = TestBed.inject(UploadService);
|
||||
|
||||
|
@@ -17,7 +17,6 @@
|
||||
|
||||
import { Component, ViewChild } from '@angular/core';
|
||||
import { ToggleIconDirective } from './toggle-icon.directive';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
@Component({
|
||||
@@ -35,14 +34,13 @@ describe('ToggleIconDirective', () => {
|
||||
let fixture: ComponentFixture<TestComponent>;
|
||||
let component: TestComponent;
|
||||
|
||||
setupTestBed({
|
||||
declarations: [
|
||||
TestComponent,
|
||||
ToggleIconDirective
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [
|
||||
TestComponent,
|
||||
ToggleIconDirective
|
||||
]
|
||||
});
|
||||
fixture = TestBed.createComponent(TestComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
|
@@ -19,7 +19,7 @@ import { Component } from '@angular/core';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { TestBed, ComponentFixture } from '@angular/core/testing';
|
||||
import { setupTestBed, CoreTestingModule } from '@alfresco/adf-core';
|
||||
import { CoreTestingModule } from '@alfresco/adf-core';
|
||||
import { VersionCompatibilityService } from './version-compatibility.service';
|
||||
import { VersionInfo } from '@alfresco/js-api';
|
||||
import { VersionCompatibilityModule } from './version-compatibility.module';
|
||||
@@ -59,16 +59,15 @@ describe('VersionCompatibilityDirective', () => {
|
||||
patch: '1'
|
||||
});
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
CoreTestingModule,
|
||||
VersionCompatibilityModule
|
||||
],
|
||||
declarations: [TestComponent]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
CoreTestingModule,
|
||||
VersionCompatibilityModule
|
||||
],
|
||||
declarations: [TestComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(TestComponent);
|
||||
versionCompatibilityService = TestBed.inject(VersionCompatibilityService);
|
||||
spyOn(versionCompatibilityService, 'getAcsVersion').and.returnValue(acsResponceMock);
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { CoreTestingModule, setupTestBed } from '@alfresco/adf-core';
|
||||
import { CoreTestingModule } from '@alfresco/adf-core';
|
||||
import { RepositoryInfo } from '@alfresco/js-api';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
@@ -37,22 +37,21 @@ describe('VersionCompatibilityService', () => {
|
||||
}
|
||||
};
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
CoreTestingModule
|
||||
],
|
||||
providers: [
|
||||
{
|
||||
provide: DiscoveryApiService,
|
||||
useValue: {
|
||||
ecmProductInfo$: mockProductInfo
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
CoreTestingModule
|
||||
],
|
||||
providers: [
|
||||
{
|
||||
provide: DiscoveryApiService,
|
||||
useValue: {
|
||||
ecmProductInfo$: mockProductInfo
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
discoveryApiService = TestBed.inject(DiscoveryApiService);
|
||||
versionCompatibilityService = TestBed.inject(VersionCompatibilityService);
|
||||
mockProductInfo.next(acsResponceMock as RepositoryInfo);
|
||||
|
@@ -17,7 +17,6 @@
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { VersionComparisonComponent } from './version-comparison.component';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
@@ -51,15 +50,14 @@ describe('VersionComparisonComponent', () => {
|
||||
slice: null
|
||||
} as File;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
});
|
||||
fixture = TestBed.createComponent(VersionComparisonComponent);
|
||||
component = fixture.componentInstance;
|
||||
component.node = node;
|
||||
|
@@ -19,7 +19,6 @@ 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 { setupTestBed } from '@alfresco/adf-core';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { of } from 'rxjs';
|
||||
import { Node, VersionPaging, VersionEntry, NodeEntry } from '@alfresco/js-api';
|
||||
@@ -41,20 +40,19 @@ describe('VersionListComponent', () => {
|
||||
{ entry: { name: 'test-file-name-two', id: '1.0', versionComment: 'test-version-comment' } } as VersionEntry
|
||||
];
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
fixture.destroy();
|
||||
TestBed.resetTestingModule();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
});
|
||||
fixture = TestBed.createComponent(VersionListComponent);
|
||||
dialog = TestBed.inject(MatDialog);
|
||||
contentVersionService = TestBed.inject(ContentVersionService);
|
||||
|
@@ -18,7 +18,6 @@
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { Node, VersionPaging } from '@alfresco/js-api';
|
||||
import { VersionManagerComponent } from './version-manager.component';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
@@ -45,15 +44,14 @@ describe('VersionManagerComponent', () => {
|
||||
}
|
||||
};
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
});
|
||||
fixture = TestBed.createComponent(VersionManagerComponent);
|
||||
component = fixture.componentInstance;
|
||||
component.node = node;
|
||||
|
@@ -19,7 +19,6 @@ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { VersionUploadComponent } from './version-upload.component';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
import { UploadService } from '../common/services/upload.service';
|
||||
@@ -48,16 +47,15 @@ describe('VersionUploadComponent', () => {
|
||||
}
|
||||
});
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
providers: [UploadService],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
providers: [UploadService],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
});
|
||||
fixture = TestBed.createComponent(VersionUploadComponent);
|
||||
component = fixture.componentInstance;
|
||||
uploadService = TestBed.inject(UploadService);
|
||||
|
@@ -18,7 +18,6 @@
|
||||
import { Location } from '@angular/common';
|
||||
import { SpyLocation } from '@angular/common/testing';
|
||||
import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
|
||||
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
@@ -27,12 +26,7 @@ import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { NodeEntry, VersionEntry } from '@alfresco/js-api';
|
||||
import { AlfrescoViewerComponent, NodeActionsService, RenditionService } from '@alfresco/adf-content-services';
|
||||
import {
|
||||
CoreTestingModule,
|
||||
setupTestBed,
|
||||
EventMock,
|
||||
ViewUtilService, ViewerComponent
|
||||
} from '@alfresco/adf-core';
|
||||
import { CoreTestingModule, EventMock, ViewUtilService, ViewerComponent } from '@alfresco/adf-core';
|
||||
import { NodesApiService } from '../../common/services/nodes-api.service';
|
||||
import { UploadService } from '../../common/services/upload.service';
|
||||
import { FileModel } from '../../common/models/file.model';
|
||||
@@ -152,35 +146,34 @@ describe('AlfrescoViewerComponent', () => {
|
||||
let viewUtilService: ViewUtilService;
|
||||
let nodeActionsService: NodeActionsService;
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
NoopAnimationsModule,
|
||||
TranslateModule.forRoot(),
|
||||
CoreTestingModule,
|
||||
MatButtonModule,
|
||||
MatIconModule
|
||||
],
|
||||
declarations: [
|
||||
ViewerWithCustomToolbarComponent,
|
||||
ViewerWithCustomSidebarComponent,
|
||||
ViewerWithCustomOpenWithComponent,
|
||||
ViewerWithCustomMoreActionsComponent,
|
||||
ViewerWithCustomToolbarActionsComponent
|
||||
],
|
||||
providers: [
|
||||
{
|
||||
provide: RenditionService, useValue: {
|
||||
getNodeRendition: () => throwError('thrown'),
|
||||
generateMediaTracksRendition: () => {}
|
||||
}
|
||||
},
|
||||
{provide: Location, useClass: SpyLocation},
|
||||
MatDialog
|
||||
],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
NoopAnimationsModule,
|
||||
TranslateModule.forRoot(),
|
||||
CoreTestingModule,
|
||||
MatButtonModule,
|
||||
MatIconModule
|
||||
],
|
||||
declarations: [
|
||||
ViewerWithCustomToolbarComponent,
|
||||
ViewerWithCustomSidebarComponent,
|
||||
ViewerWithCustomOpenWithComponent,
|
||||
ViewerWithCustomMoreActionsComponent,
|
||||
ViewerWithCustomToolbarActionsComponent
|
||||
],
|
||||
providers: [
|
||||
{
|
||||
provide: RenditionService, useValue: {
|
||||
getNodeRendition: () => throwError('thrown'),
|
||||
generateMediaTracksRendition: () => {}
|
||||
}
|
||||
},
|
||||
{provide: Location, useClass: SpyLocation},
|
||||
MatDialog
|
||||
],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
});
|
||||
fixture = TestBed.createComponent(AlfrescoViewerComponent);
|
||||
element = fixture.nativeElement;
|
||||
component = fixture.componentInstance;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user