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