mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
ACS-10908 Cleanup unit test configuration for Content (#11470)
This commit is contained in:
@@ -19,7 +19,6 @@ import { MAT_DIALOG_DATA, MatDialogModule, MatDialogRef } from '@angular/materia
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { AspectListDialogComponent } from './aspect-list-dialog.component';
|
||||
import { of, Subject } from 'rxjs';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
import { AspectListDialogComponentData } from './aspect-list-dialog-data.interface';
|
||||
import { AspectListService } from './services/aspect-list.service';
|
||||
import { delay } from 'rxjs/operators';
|
||||
@@ -27,6 +26,7 @@ import { AspectEntry, Node } from '@alfresco/js-api';
|
||||
import { NodesApiService } from '../common/services/nodes-api.service';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { AspectListComponent } from './aspect-list.component';
|
||||
import { provideApiTesting } from '../testing/providers';
|
||||
|
||||
const aspectListMock: AspectEntry[] = [
|
||||
{
|
||||
@@ -104,7 +104,7 @@ describe('AspectListDialogComponent', () => {
|
||||
keyCode: 27
|
||||
} as KeyboardEventInit);
|
||||
|
||||
beforeEach(async () => {
|
||||
beforeEach(() => {
|
||||
data = {
|
||||
title: 'Title',
|
||||
description: 'Description that can be longer or shorter',
|
||||
@@ -112,9 +112,10 @@ describe('AspectListDialogComponent', () => {
|
||||
select: new Subject<string[]>(),
|
||||
excludedAspects: []
|
||||
};
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule, MatDialogModule],
|
||||
TestBed.configureTestingModule({
|
||||
imports: [MatDialogModule],
|
||||
providers: [
|
||||
provideApiTesting(),
|
||||
{ provide: MAT_DIALOG_DATA, useValue: data },
|
||||
{
|
||||
provide: MatDialogRef,
|
||||
@@ -125,7 +126,7 @@ describe('AspectListDialogComponent', () => {
|
||||
}
|
||||
}
|
||||
]
|
||||
}).compileComponents();
|
||||
});
|
||||
fixture = TestBed.createComponent(AspectListDialogComponent);
|
||||
});
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { NodesApiService } from '../common/services/nodes-api.service';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
import { AspectListComponent } from './aspect-list.component';
|
||||
import { AspectListService, CustomAspectsWhere, StandardAspectsWhere } from './services/aspect-list.service';
|
||||
import { EMPTY, of } from 'rxjs';
|
||||
@@ -29,6 +28,7 @@ import { MatTableHarness } from '@angular/material/table/testing';
|
||||
import { MatCheckboxHarness } from '@angular/material/checkbox/testing';
|
||||
import { MatProgressSpinnerHarness } from '@angular/material/progress-spinner/testing';
|
||||
import { CustomAspectPaging } from './interfaces/custom-aspect-paging.interface';
|
||||
import { provideApiTesting } from '../testing/providers';
|
||||
|
||||
const aspectListMock: AspectEntry[] = [
|
||||
{
|
||||
@@ -125,8 +125,8 @@ describe('AspectListComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule, AspectListComponent],
|
||||
providers: [AspectListService]
|
||||
imports: [AspectListComponent],
|
||||
providers: [provideApiTesting()]
|
||||
});
|
||||
|
||||
fixture = TestBed.createComponent(AspectListComponent);
|
||||
|
||||
+2
-2
@@ -15,7 +15,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { DialogAspectListService } from './dialog-aspect-list.service';
|
||||
import { AspectListDialogComponent } from '../aspect-list-dialog.component';
|
||||
import { AspectListDialogComponentData } from '../aspect-list-dialog-data.interface';
|
||||
@@ -24,6 +23,7 @@ import { TagService } from '../../tag/services/tag.service';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { MatDialog, MatDialogConfig, MatDialogRef } from '@angular/material/dialog';
|
||||
import { Observable, Subject } from 'rxjs';
|
||||
import { provideApiTesting } from '../../testing/providers';
|
||||
|
||||
describe('DialogAspectListService', () => {
|
||||
let dialogAspectListService: DialogAspectListService;
|
||||
@@ -31,7 +31,7 @@ describe('DialogAspectListService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule]
|
||||
providers: [provideApiTesting()]
|
||||
});
|
||||
dialogAspectListService = TestBed.inject(DialogAspectListService);
|
||||
dialog = TestBed.inject(MatDialog);
|
||||
|
||||
@@ -19,7 +19,6 @@ import { Node } from '@alfresco/js-api';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { NodesApiService } from '../../common/services/nodes-api.service';
|
||||
import { EMPTY, of } from 'rxjs';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { NodeAspectService } from './node-aspect.service';
|
||||
import { DialogAspectListService } from './dialog-aspect-list.service';
|
||||
import { CardViewContentUpdateService } from '../../common/services/card-view-content-update.service';
|
||||
@@ -32,9 +31,7 @@ describe('NodeAspectService', () => {
|
||||
let cardViewContentUpdateService: CardViewContentUpdateService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule]
|
||||
});
|
||||
TestBed.configureTestingModule({});
|
||||
dialogAspectListService = TestBed.inject(DialogAspectListService);
|
||||
nodeAspectService = TestBed.inject(NodeAspectService);
|
||||
nodeApiService = TestBed.inject(NodesApiService);
|
||||
|
||||
@@ -15,14 +15,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
import { fakeNodeWithCreatePermission } from '../mock';
|
||||
import { DocumentListComponent, DocumentListService } from '../document-list';
|
||||
import { BreadcrumbComponent } from './breadcrumb.component';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
import { of } from 'rxjs';
|
||||
import { NoopAuthModule } from '@alfresco/adf-core';
|
||||
|
||||
describe('Breadcrumb', () => {
|
||||
let component: BreadcrumbComponent;
|
||||
@@ -37,8 +36,7 @@ describe('Breadcrumb', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
imports: [NoopAuthModule],
|
||||
providers: [{ provide: DocumentListService, useValue: documentListService }]
|
||||
});
|
||||
fixture = TestBed.createComponent(BreadcrumbComponent);
|
||||
|
||||
@@ -15,26 +15,26 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { fakeNodeWithCreatePermission } from '../mock';
|
||||
import { DocumentListComponent, DocumentListService } from '../document-list';
|
||||
import { DropdownBreadcrumbComponent } from './dropdown-breadcrumb.component';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
import { of } from 'rxjs';
|
||||
import { NoopAuthModule } from '@alfresco/adf-core';
|
||||
|
||||
describe('DropdownBreadcrumb', () => {
|
||||
let component: DropdownBreadcrumbComponent;
|
||||
let fixture: ComponentFixture<DropdownBreadcrumbComponent>;
|
||||
let documentList: DocumentListComponent;
|
||||
let documentListService: DocumentListService = jasmine.createSpyObj({ loadFolderByNodeId: of(''), isCustomSourceService: false });
|
||||
let documentListService: DocumentListService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
providers: [{ provide: DocumentListService, useValue: documentListService }]
|
||||
imports: [NoopAuthModule],
|
||||
providers: [
|
||||
{ provide: DocumentListService, useValue: jasmine.createSpyObj({ loadFolderByNodeId: of(''), isCustomSourceService: false }) }
|
||||
]
|
||||
});
|
||||
fixture = TestBed.createComponent(DropdownBreadcrumbComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
+1
-2
@@ -22,7 +22,6 @@ import { MatError } from '@angular/material/form-field';
|
||||
import { MatList } from '@angular/material/list';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { of, Subject } from 'rxjs';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { CategoriesManagementMode } from './categories-management-mode';
|
||||
import { CategoryService } from '../services/category.service';
|
||||
import { CategoriesManagementComponent } from './categories-management.component';
|
||||
@@ -47,7 +46,7 @@ describe('CategoriesManagementComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule, CategoriesManagementComponent],
|
||||
imports: [CategoriesManagementComponent],
|
||||
providers: [
|
||||
{
|
||||
provide: CategoryService,
|
||||
|
||||
+2
-2
@@ -30,7 +30,7 @@ import { MatSnackBarModule } from '@angular/material/snack-bar';
|
||||
import { CategoryService } from '../../../category';
|
||||
import { TagService } from '../../../tag';
|
||||
import { PropertyDescriptorsService } from '../../public-api';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { NoopAuthModule } from '@alfresco/adf-core';
|
||||
|
||||
describe('ContentMetadataCardComponent', () => {
|
||||
let component: ContentMetadataCardComponent;
|
||||
@@ -47,7 +47,7 @@ describe('ContentMetadataCardComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule, MatDialogModule, MatSnackBarModule, ContentMetadataCardComponent]
|
||||
imports: [NoopAuthModule, MatDialogModule, MatSnackBarModule, ContentMetadataCardComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(ContentMetadataCardComponent);
|
||||
contentMetadataService = TestBed.inject(ContentMetadataService);
|
||||
|
||||
+3
-3
@@ -24,7 +24,8 @@ import {
|
||||
CardViewComponent,
|
||||
NotificationService,
|
||||
UpdateNotification,
|
||||
UnitTestingUtils
|
||||
UnitTestingUtils,
|
||||
NoopAuthModule
|
||||
} from '@alfresco/adf-core';
|
||||
import { NodesApiService } from '../../../common/services/nodes-api.service';
|
||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
@@ -35,7 +36,6 @@ import { MatSnackBarModule } from '@angular/material/snack-bar';
|
||||
import { EMPTY, firstValueFrom, of, throwError } from 'rxjs';
|
||||
import { CategoriesManagementComponent, CategoriesManagementMode } from '../../../category';
|
||||
import { TagsCreatorComponent, TagsCreatorMode } from '../../../tag';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { PropertyGroup } from '../../interfaces/property-group.interface';
|
||||
import { PropertyDescriptorsService } from '../../services/property-descriptors.service';
|
||||
import { TagService } from '../../../tag/services/tag.service';
|
||||
@@ -184,7 +184,7 @@ describe('ContentMetadataComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule, MatDialogModule, MatSnackBarModule, ContentMetadataComponent],
|
||||
imports: [NoopAuthModule, MatDialogModule, MatSnackBarModule, ContentMetadataComponent],
|
||||
providers: [
|
||||
{
|
||||
provide: TagService,
|
||||
|
||||
+5
-8
@@ -15,11 +15,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AppConfigService } from '@alfresco/adf-core';
|
||||
import { AppConfigService, CardViewItem, NoopAuthModule } from '@alfresco/adf-core';
|
||||
import { ClassesApi, Node } from '@alfresco/js-api';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { firstValueFrom, of } from 'rxjs';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { OrganisedPropertyGroup } from '../interfaces/content-metadata.interfaces';
|
||||
import { PropertyGroup } from '../interfaces/property-group.interface';
|
||||
import { ContentMetadataService } from './content-metadata.service';
|
||||
@@ -197,7 +196,7 @@ describe('ContentMetaDataService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule]
|
||||
imports: [NoopAuthModule]
|
||||
});
|
||||
service = TestBed.inject(ContentMetadataService);
|
||||
contentPropertyService = TestBed.inject(ContentTypePropertiesService);
|
||||
@@ -216,12 +215,10 @@ describe('ContentMetaDataService', () => {
|
||||
});
|
||||
|
||||
it('should return the content type property', () => {
|
||||
spyOn(contentPropertyService, 'getContentTypeCardItem').and.returnValue(of({ label: 'hello i am a weird content type' } as any));
|
||||
spyOn(contentPropertyService, 'getContentTypeCardItem').and.returnValue(of([{ label: 'hello i am a weird content type' } as CardViewItem]));
|
||||
|
||||
service.getContentTypeProperty(fakeNode).subscribe((res: any) => {
|
||||
expect(res).toBeDefined();
|
||||
expect(res).not.toBeNull();
|
||||
expect(res.label).toBe('hello i am a weird content type');
|
||||
service.getContentTypeProperty(fakeNode).subscribe((res) => {
|
||||
expect(res[0].label).toBe('hello i am a weird content type');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
+2
-3
@@ -17,8 +17,7 @@
|
||||
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { ContentTypePropertiesService } from './content-type-property.service';
|
||||
import { CardViewItem, CardViewSelectItemModel, CardViewTextItemModel } from '@alfresco/adf-core';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { CardViewItem, CardViewSelectItemModel, CardViewTextItemModel, NoopAuthModule } from '@alfresco/adf-core';
|
||||
import { ContentTypeService } from '../../content-type';
|
||||
import { of } from 'rxjs';
|
||||
import { Node, TypeEntry } from '@alfresco/js-api';
|
||||
@@ -126,7 +125,7 @@ describe('ContentTypePropertyService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule]
|
||||
imports: [NoopAuthModule]
|
||||
});
|
||||
service = TestBed.inject(ContentTypePropertiesService);
|
||||
versionCompatibilityService = TestBed.inject(VersionCompatibilityService);
|
||||
|
||||
+2
-5
@@ -19,18 +19,15 @@ import { TestBed } from '@angular/core/testing';
|
||||
import { PropertyDescriptorsService } from './property-descriptors.service';
|
||||
import { ClassesApi } from '@alfresco/js-api';
|
||||
import { PropertyGroup } from '../interfaces/content-metadata.interfaces';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
|
||||
describe('PropertyDescriptorLoaderService', () => {
|
||||
let service: PropertyDescriptorsService;
|
||||
let classesApi: ClassesApi;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule]
|
||||
});
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(PropertyDescriptorsService);
|
||||
classesApi = service['classesApi'];
|
||||
classesApi = service.classesApi;
|
||||
});
|
||||
|
||||
it('should load the groups passed by paramter', (done) => {
|
||||
|
||||
+1
-2
@@ -31,7 +31,6 @@ import {
|
||||
LogService,
|
||||
CardViewLongItemModel
|
||||
} from '@alfresco/adf-core';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { Constraint, Definition, Property as PropertyBase } from '@alfresco/js-api';
|
||||
|
||||
describe('PropertyGroupTranslatorService', () => {
|
||||
@@ -44,7 +43,7 @@ describe('PropertyGroupTranslatorService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule]
|
||||
imports: []
|
||||
});
|
||||
logService = TestBed.inject(LogService);
|
||||
service = TestBed.inject(PropertyGroupTranslatorService);
|
||||
|
||||
+10
-10
@@ -21,8 +21,8 @@ import { DocumentListService, NodeAction } from '../document-list';
|
||||
import { ContentNodeDialogService } from './content-node-dialog.service';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { Subject, of } from 'rxjs';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
import { SitesService } from '../common';
|
||||
import { NoopAuthModule } from '@alfresco/adf-core';
|
||||
|
||||
const fakeNodeEntry = {
|
||||
entry: {
|
||||
@@ -67,7 +67,7 @@ describe('ContentNodeDialogService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule]
|
||||
imports: [NoopAuthModule]
|
||||
});
|
||||
service = TestBed.inject(ContentNodeDialogService);
|
||||
documentListService = TestBed.inject(DocumentListService);
|
||||
@@ -89,12 +89,12 @@ describe('ContentNodeDialogService', () => {
|
||||
isFile: false
|
||||
} as Node;
|
||||
|
||||
service.openLockNodeDialog(testNode).subscribe(
|
||||
() => {},
|
||||
(error) => {
|
||||
service.openLockNodeDialog(testNode).subscribe({
|
||||
next: () => {},
|
||||
error: (error) => {
|
||||
expect(error).toBe('OPERATION.FAIL.NODE.NO_PERMISSION');
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
it('should be able to open the dialog when node has permission', () => {
|
||||
@@ -103,13 +103,13 @@ describe('ContentNodeDialogService', () => {
|
||||
});
|
||||
|
||||
it('should NOT be able to open the dialog when node has NOT permission', () => {
|
||||
service.openCopyMoveDialog(NodeAction.CHOOSE, fakeNode, 'noperm').subscribe(
|
||||
() => {},
|
||||
(error) => {
|
||||
service.openCopyMoveDialog(NodeAction.CHOOSE, fakeNode, 'noperm').subscribe({
|
||||
next: () => {},
|
||||
error: (error) => {
|
||||
expect(spyOnDialogOpen).not.toHaveBeenCalled();
|
||||
expect(JSON.parse(error.message).error.statusCode).toBe(403);
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
it('should be able to open the dialog using a folder id', fakeAsync(() => {
|
||||
|
||||
+7
-9
@@ -15,13 +15,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { CUSTOM_ELEMENTS_SCHEMA, DebugElement } from '@angular/core';
|
||||
import { DebugElement } from '@angular/core';
|
||||
import { ComponentFixture, fakeAsync, flush, TestBed, tick } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { Node, NodeEntry, NodePaging, RequestScope, ResultSetPaging, SiteEntry, SitePaging, SitePagingList } from '@alfresco/js-api';
|
||||
import { of } from 'rxjs';
|
||||
import { ContentNodeSelectorPanelComponent } from './content-node-selector-panel.component';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { DocumentListService } from '../../document-list/services/document-list.service';
|
||||
import { DocumentListComponent } from '../../document-list/components/document-list.component';
|
||||
import { CustomResourcesService } from '../../document-list/services/custom-resources.service';
|
||||
@@ -31,6 +30,8 @@ import { mockSearchRequest } from '../../mock/search-query.mock';
|
||||
import { SitesService } from '../../common/services/sites.service';
|
||||
import { NodesApiService } from '../../common/services/nodes-api.service';
|
||||
import { UnitTestingUtils } from '../../../../../core/src/lib/testing/unit-testing-utils';
|
||||
import { provideRouter } from '@angular/router';
|
||||
import { NoopAuthModule } from '@alfresco/adf-core';
|
||||
|
||||
const fakeResultSetPaging: ResultSetPaging = {
|
||||
list: {
|
||||
@@ -77,15 +78,12 @@ describe('ContentNodeSelectorPanelComponent', () => {
|
||||
service.executed.next(searchResults);
|
||||
};
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
});
|
||||
});
|
||||
|
||||
describe('General component features', () => {
|
||||
beforeEach(async () => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [NoopAuthModule],
|
||||
providers: [provideRouter([])]
|
||||
});
|
||||
fixture = TestBed.createComponent(ContentNodeSelectorPanelComponent);
|
||||
component = fixture.componentInstance;
|
||||
component.debounceSearch = 0;
|
||||
|
||||
+7
-10
@@ -15,22 +15,22 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { Node, NodeEntry, NodePaging, ResultSetPaging, Site, SiteEntry, SitePaging, SitePagingList, UserInfo } from '@alfresco/js-api';
|
||||
import { DataRow, ThumbnailService, DataColumn } from '@alfresco/adf-core';
|
||||
import { DataRow, ThumbnailService, DataColumn, NoopAuthModule } from '@alfresco/adf-core';
|
||||
import { ContentService, UploadService, NodesApiService, SitesService, FileModel, FileUploadStatus, FileUploadCompleteEvent } from '../../common';
|
||||
import { of, throwError } from 'rxjs';
|
||||
import { DropdownBreadcrumbComponent } from '../../breadcrumb';
|
||||
import { ContentNodeSelectorPanelComponent } from './content-node-selector-panel.component';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { DocumentListService } from '../../document-list/services/document-list.service';
|
||||
import { DropdownSitesComponent } from '../site-dropdown/sites-dropdown.component';
|
||||
import { NodeEntryEvent, ShareDataRow, ShareDataTableAdapter } from '../../document-list';
|
||||
import { SearchQueryBuilderService } from '../../search';
|
||||
import { ContentNodeSelectorPanelService } from './content-node-selector-panel.service';
|
||||
import { mockContentModelTextProperty } from '../../mock/content-model.mock';
|
||||
import { provideRouter } from '@angular/router';
|
||||
import { provideApiTesting } from '../../testing/providers';
|
||||
|
||||
const fakeResultSetPaging: ResultSetPaging = {
|
||||
list: {
|
||||
@@ -69,15 +69,12 @@ describe('ContentNodeSelectorPanelComponent', () => {
|
||||
service.executed.next(searchResults);
|
||||
};
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
});
|
||||
});
|
||||
|
||||
describe('General component features', () => {
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [NoopAuthModule, ContentNodeSelectorPanelComponent],
|
||||
providers: [provideRouter([]), provideApiTesting()]
|
||||
});
|
||||
fixture = TestBed.createComponent(ContentNodeSelectorPanelComponent);
|
||||
component = fixture.componentInstance;
|
||||
component.debounceSearch = 0;
|
||||
|
||||
+4
-5
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { CUSTOM_ELEMENTS_SCHEMA, EventEmitter } from '@angular/core';
|
||||
import { EventEmitter } from '@angular/core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ContentNodeSelectorComponent } from './content-node-selector.component';
|
||||
import { Node, NodeEntry, SitePaging, SitePagingList } from '@alfresco/js-api';
|
||||
@@ -25,7 +25,6 @@ import { FileModel } from '../common/models/file.model';
|
||||
import { FileUploadEvent } from '../common/events/file.event';
|
||||
import { UploadService } from '../common/services/upload.service';
|
||||
import { of } from 'rxjs';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
import { DocumentListService } from '../document-list/services/document-list.service';
|
||||
import { DocumentListComponent } from '../document-list/components/document-list.component';
|
||||
import { ContentNodeSelectorPanelComponent } from './content-node-selector-panel/content-node-selector-panel.component';
|
||||
@@ -36,6 +35,7 @@ import { ContentService } from '../common/services/content.service';
|
||||
import { HarnessLoader } from '@angular/cdk/testing';
|
||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
import { MatTabGroupHarness } from '@angular/material/tabs/testing';
|
||||
import { NoopAuthModule } from '@alfresco/adf-core';
|
||||
|
||||
describe('ContentNodeSelectorComponent', () => {
|
||||
let component: ContentNodeSelectorComponent;
|
||||
@@ -59,7 +59,7 @@ describe('ContentNodeSelectorComponent', () => {
|
||||
};
|
||||
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule, ContentNodeSelectorComponent],
|
||||
imports: [NoopAuthModule, ContentNodeSelectorComponent],
|
||||
providers: [
|
||||
{ provide: MAT_DIALOG_DATA, useValue: data },
|
||||
{
|
||||
@@ -72,8 +72,7 @@ describe('ContentNodeSelectorComponent', () => {
|
||||
afterOpened: () => of(null)
|
||||
}
|
||||
}
|
||||
],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
]
|
||||
});
|
||||
|
||||
const documentListService = TestBed.inject(DocumentListService);
|
||||
|
||||
+2
-3
@@ -17,7 +17,7 @@
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { DropdownSitesComponent, Relations } from './sites-dropdown.component';
|
||||
import { AuthenticationService } from '@alfresco/adf-core';
|
||||
import { AuthenticationService, NoopAuthModule } from '@alfresco/adf-core';
|
||||
import { of } from 'rxjs';
|
||||
import {
|
||||
getFakeSitePaging,
|
||||
@@ -26,7 +26,6 @@ import {
|
||||
getFakeSitePagingLastPage,
|
||||
getFakeSitePagingWithMembers
|
||||
} from '../../mock';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { SitesService } from '../../common/services/sites.service';
|
||||
import { HarnessLoader } from '@angular/cdk/testing';
|
||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
@@ -62,7 +61,7 @@ describe('DropdownSitesComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule]
|
||||
imports: [NoopAuthModule]
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -18,17 +18,18 @@
|
||||
import { TestBed, ComponentFixture } from '@angular/core/testing';
|
||||
import { MatDialogRef, MAT_DIALOG_DATA, MatDialog, MatDialogModule } from '@angular/material/dialog';
|
||||
import { of } from 'rxjs';
|
||||
import { NotificationService } from '@alfresco/adf-core';
|
||||
import { NoopAuthModule, NotificationService } from '@alfresco/adf-core';
|
||||
import { NodesApiService, RenditionService } from '../common';
|
||||
import { SharedLinksApiService } from './services/shared-links-api.service';
|
||||
import { ShareDialogComponent } from './content-node-share.dialog';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
import { format, endOfDay } from 'date-fns';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { NodeEntry } from '@alfresco/js-api';
|
||||
import { HarnessLoader } from '@angular/cdk/testing';
|
||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
import { MatSlideToggleHarness } from '@angular/material/slide-toggle/testing';
|
||||
import { MatDatetimepickerModule, MatNativeDatetimeModule } from '@mat-datetimepicker/core';
|
||||
import { provideApiTesting } from '../testing/providers';
|
||||
|
||||
describe('ShareDialogComponent', () => {
|
||||
let loader: HarnessLoader;
|
||||
@@ -55,8 +56,9 @@ describe('ShareDialogComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule, MatDialogModule, ShareDialogComponent],
|
||||
imports: [NoopAuthModule, MatDatetimepickerModule, MatNativeDatetimeModule, MatDialogModule, ShareDialogComponent],
|
||||
providers: [
|
||||
provideApiTesting(),
|
||||
{ provide: NotificationService, useValue: notificationServiceMock },
|
||||
{
|
||||
provide: MatDialogRef,
|
||||
|
||||
+5
-5
@@ -19,9 +19,9 @@ import { TestBed, ComponentFixture } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { Component } from '@angular/core';
|
||||
import { DOCUMENT } from '@angular/common';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
import { CoreModule } from '@alfresco/adf-core';
|
||||
import { NodeSharedDirective } from '@alfresco/adf-content-services';
|
||||
import { NodeSharedDirective } from './content-node-share.directive';
|
||||
import { NoopAuthModule } from '@alfresco/adf-core';
|
||||
import { MatNativeDatetimeModule } from '@mat-datetimepicker/core';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-node-share-test-component',
|
||||
@@ -46,13 +46,13 @@ class NodeShareTestComponent {
|
||||
describe('NodeSharedDirective', () => {
|
||||
let fixture: ComponentFixture<NodeShareTestComponent>;
|
||||
let component: NodeShareTestComponent;
|
||||
let document: any;
|
||||
let document: Document;
|
||||
let shareButtonElement;
|
||||
let selection;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreModule.forRoot(), ContentTestingModule, NodeShareTestComponent]
|
||||
imports: [NoopAuthModule, NodeShareTestComponent, MatNativeDatetimeModule]
|
||||
});
|
||||
fixture = TestBed.createComponent(NodeShareTestComponent);
|
||||
document = TestBed.inject(DOCUMENT);
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
import { TypeEntry } from '@alfresco/js-api';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { of, Subject } from 'rxjs';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
import { ContentTypeDialogComponent } from './content-type-dialog.component';
|
||||
import { ContentTypeDialogComponentData } from './content-type-metadata.interface';
|
||||
import { HarnessLoader } from '@angular/cdk/testing';
|
||||
@@ -87,7 +86,7 @@ describe('Content Type Dialog Component', () => {
|
||||
let data: ContentTypeDialogComponentData;
|
||||
let loader: HarnessLoader;
|
||||
|
||||
beforeEach(async () => {
|
||||
beforeEach(() => {
|
||||
data = {
|
||||
title: 'Title',
|
||||
description: 'Description that can be longer or shorter',
|
||||
@@ -97,7 +96,7 @@ describe('Content Type Dialog Component', () => {
|
||||
};
|
||||
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule, MatDialogModule],
|
||||
imports: [MatDialogModule],
|
||||
providers: [
|
||||
{ provide: MAT_DIALOG_DATA, useValue: data },
|
||||
{
|
||||
@@ -109,7 +108,7 @@ describe('Content Type Dialog Component', () => {
|
||||
}
|
||||
}
|
||||
]
|
||||
}).compileComponents();
|
||||
});
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -18,10 +18,8 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { MatDialogRef } from '@angular/material/dialog';
|
||||
import { NodesApiService } from '../../common/services/nodes-api.service';
|
||||
|
||||
import { FolderDialogComponent } from './folder.dialog';
|
||||
import { BehaviorSubject, throwError } from 'rxjs';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { By } from '@angular/platform-browser';
|
||||
|
||||
describe('FolderDialogComponent', () => {
|
||||
@@ -41,7 +39,7 @@ describe('FolderDialogComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule],
|
||||
imports: [],
|
||||
providers: [{ provide: MatDialogRef, useValue: dialogRef }]
|
||||
});
|
||||
dialogRef.close.calls.reset();
|
||||
|
||||
@@ -17,9 +17,7 @@
|
||||
|
||||
import { LibraryDialogComponent } from './library.dialog';
|
||||
import { TestBed, fakeAsync, tick, flush, ComponentFixture, flushMicrotasks } from '@angular/core/testing';
|
||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { MatDialogRef } from '@angular/material/dialog';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { of, throwError } from 'rxjs';
|
||||
import { delay } from 'rxjs/operators';
|
||||
import { FindQuery, SiteEntry, SitePaging } from '@alfresco/js-api';
|
||||
@@ -28,6 +26,7 @@ import { NotificationService, UnitTestingUtils } from '@alfresco/adf-core';
|
||||
import { HarnessLoader } from '@angular/cdk/testing';
|
||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
import { MatRadioGroupHarness } from '@angular/material/radio/testing';
|
||||
import { provideApiTesting } from '../../testing/providers';
|
||||
|
||||
describe('LibraryDialogComponent', () => {
|
||||
let fixture: ComponentFixture<LibraryDialogComponent>;
|
||||
@@ -58,14 +57,13 @@ describe('LibraryDialogComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule, LibraryDialogComponent],
|
||||
providers: [{ provide: MatDialogRef, useValue: dialogRef }],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
imports: [LibraryDialogComponent],
|
||||
providers: [provideApiTesting(), { provide: MatDialogRef, useValue: dialogRef }]
|
||||
});
|
||||
fixture = TestBed.createComponent(LibraryDialogComponent);
|
||||
component = fixture.componentInstance;
|
||||
sitesService = TestBed.inject(SitesService);
|
||||
findSitesSpy = spyOn(component['queriesApi'], 'findSites');
|
||||
findSitesSpy = spyOn(component.queriesApi, 'findSites');
|
||||
notificationService = TestBed.inject(NotificationService);
|
||||
loader = TestbedHarnessEnvironment.loader(fixture);
|
||||
unitTestingUtils = new UnitTestingUtils(fixture.debugElement, loader);
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
import { TestBed, fakeAsync, tick, ComponentFixture } from '@angular/core/testing';
|
||||
import { MatDialogRef } from '@angular/material/dialog';
|
||||
import { NodeLockDialogComponent } from './node-lock.dialog';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { addMinutes } from 'date-fns';
|
||||
import { Node, NodeEntry } from '@alfresco/js-api';
|
||||
import { MatNativeDatetimeModule } from '@mat-datetimepicker/core';
|
||||
|
||||
describe('NodeLockDialogComponent', () => {
|
||||
let fixture: ComponentFixture<NodeLockDialogComponent>;
|
||||
@@ -67,7 +67,7 @@ describe('NodeLockDialogComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule, NodeLockDialogComponent],
|
||||
imports: [NodeLockDialogComponent, MatNativeDatetimeModule],
|
||||
providers: [{ provide: MatDialogRef, useValue: dialogRef }]
|
||||
});
|
||||
fixture = TestBed.createComponent(NodeLockDialogComponent);
|
||||
|
||||
@@ -19,9 +19,7 @@ import { Component, ViewChild } from '@angular/core';
|
||||
import { LibraryFavoriteDirective } from './library-favorite.directive';
|
||||
import { TestBed, ComponentFixture } from '@angular/core/testing';
|
||||
import { LibraryEntity } from '../interfaces/library-entity.interface';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { NotificationService } from '@alfresco/adf-core';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
|
||||
@Component({
|
||||
imports: [LibraryFavoriteDirective],
|
||||
@@ -43,7 +41,7 @@ describe('LibraryFavoriteDirective', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [HttpClientTestingModule, TestComponent, LibraryFavoriteDirective, ContentTestingModule]
|
||||
imports: [TestComponent, LibraryFavoriteDirective]
|
||||
});
|
||||
notificationService = TestBed.inject(NotificationService);
|
||||
fixture = TestBed.createComponent(TestComponent);
|
||||
|
||||
@@ -19,10 +19,8 @@ import { SimpleChange } from '@angular/core';
|
||||
import { fakeAsync, TestBed, tick } from '@angular/core/testing';
|
||||
import { NodeFavoriteDirective } from './node-favorite.directive';
|
||||
import { AppConfigService, AppConfigServiceMock, NotificationService } from '@alfresco/adf-core';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { AlfrescoApiService } from '../services';
|
||||
import { AlfrescoApiServiceMock } from '../mock';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
import { provideApiTesting } from '../testing/providers';
|
||||
|
||||
describe('NodeFavoriteDirective', () => {
|
||||
let directive: NodeFavoriteDirective;
|
||||
@@ -31,11 +29,8 @@ describe('NodeFavoriteDirective', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [HttpClientTestingModule, ContentTestingModule],
|
||||
providers: [
|
||||
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
|
||||
{ provide: AppConfigService, useClass: AppConfigServiceMock }
|
||||
]
|
||||
imports: [],
|
||||
providers: [provideApiTesting(), { provide: AppConfigService, useClass: AppConfigServiceMock }]
|
||||
});
|
||||
alfrescoApiService = TestBed.inject(AlfrescoApiService);
|
||||
notificationService = TestBed.inject(NotificationService);
|
||||
|
||||
@@ -21,7 +21,8 @@ import { Component, DebugElement } from '@angular/core';
|
||||
import { NodeLockDirective } from './node-lock.directive';
|
||||
import type { Node } from '@alfresco/js-api';
|
||||
import { ContentNodeDialogService } from '../content-node-selector/content-node-dialog.service';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
import { provideRouter } from '@angular/router';
|
||||
import { NoopAuthModule } from '@alfresco/adf-core';
|
||||
|
||||
@Component({
|
||||
template: '<div [adf-node-lock]="node"></div>',
|
||||
@@ -40,7 +41,8 @@ describe('NodeLock Directive', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule, TestComponent]
|
||||
imports: [NoopAuthModule, TestComponent],
|
||||
providers: [provideRouter([])]
|
||||
});
|
||||
fixture = TestBed.createComponent(TestComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
+2
-4
@@ -15,12 +15,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { ContentActionModel } from './../../models/content-action.model';
|
||||
import { DocumentListComponent } from './../document-list.component';
|
||||
import { ContentActionListComponent } from './content-action-list.component';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { NoopAuthModule } from '@alfresco/adf-core';
|
||||
|
||||
describe('ContentColumnList', () => {
|
||||
let documentList: DocumentListComponent;
|
||||
@@ -28,8 +27,7 @@ describe('ContentColumnList', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
imports: [NoopAuthModule]
|
||||
});
|
||||
documentList = TestBed.createComponent(DocumentListComponent).componentInstance as DocumentListComponent;
|
||||
actionList = new ContentActionListComponent(documentList);
|
||||
|
||||
+3
-4
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { CUSTOM_ELEMENTS_SCHEMA, SimpleChange, EventEmitter } from '@angular/core';
|
||||
import { SimpleChange, EventEmitter } from '@angular/core';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { FileNode } from '../../../mock';
|
||||
import { ContentActionModel } from './../../models/content-action.model';
|
||||
@@ -25,8 +25,8 @@ import { NodeActionsService } from './../../services/node-actions.service';
|
||||
import { DocumentListComponent } from './../document-list.component';
|
||||
import { ContentActionListComponent } from './content-action-list.component';
|
||||
import { ContentActionComponent } from './content-action.component';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { ContentService } from '../../../common/services/content.service';
|
||||
import { NoopAuthModule } from '@alfresco/adf-core';
|
||||
|
||||
describe('ContentAction', () => {
|
||||
let documentList: DocumentListComponent;
|
||||
@@ -39,8 +39,7 @@ describe('ContentAction', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
imports: [NoopAuthModule]
|
||||
});
|
||||
contentService = TestBed.inject(ContentService);
|
||||
nodeActionsService = new NodeActionsService(null, null, null);
|
||||
|
||||
+5
-7
@@ -23,6 +23,7 @@ import {
|
||||
DataColumnComponent,
|
||||
DataColumnListComponent,
|
||||
DataTableComponent,
|
||||
NoopAuthModule,
|
||||
ObjectDataTableAdapter,
|
||||
ShowHeaderMode,
|
||||
ThumbnailService,
|
||||
@@ -31,7 +32,7 @@ import {
|
||||
import { FavoritePaging, FavoritePagingList, Node, NodeEntry, NodePaging } from '@alfresco/js-api';
|
||||
import { HarnessLoader } from '@angular/cdk/testing';
|
||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
import { Component, CUSTOM_ELEMENTS_SCHEMA, Injector, QueryList, runInInjectionContext, SimpleChange, SimpleChanges, ViewChild } from '@angular/core';
|
||||
import { Component, Injector, QueryList, runInInjectionContext, SimpleChange, SimpleChanges, ViewChild } from '@angular/core';
|
||||
import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
|
||||
import { MatProgressSpinnerHarness } from '@angular/material/progress-spinner/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
@@ -50,7 +51,6 @@ import {
|
||||
mockNodePagingWithPreselectedNodes,
|
||||
mockPreselectedNodes
|
||||
} from '../../mock';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { domSanitizerMock } from '../../testing/dom-sanitizer-mock';
|
||||
import { ImageResolver } from '../data/image-resolver.model';
|
||||
import { RowFilter } from '../data/row-filter.model';
|
||||
@@ -62,7 +62,6 @@ import { MatDialog } from '@angular/material/dialog';
|
||||
import { FileAutoDownloadComponent } from './file-auto-download/file-auto-download.component';
|
||||
import { DocumentListComponent } from './document-list.component';
|
||||
import { CustomResourcesService, DocumentListService } from '../public-api';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { MatIconRegistry } from '@angular/material/icon';
|
||||
|
||||
const mockDialog = {
|
||||
@@ -99,8 +98,7 @@ describe('DocumentList', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule, DocumentListComponent],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
imports: [NoopAuthModule, DocumentListComponent],
|
||||
providers: [{ provide: MatDialog, useValue: mockDialog }]
|
||||
});
|
||||
eventMock = {
|
||||
@@ -2002,7 +2000,7 @@ describe('DocumentList', () => {
|
||||
});
|
||||
|
||||
@Component({
|
||||
imports: [CommonModule, DocumentListComponent, CustomLoadingContentTemplateDirective],
|
||||
imports: [DocumentListComponent, CustomLoadingContentTemplateDirective],
|
||||
template: `
|
||||
<adf-document-list #customDocumentList>
|
||||
<adf-custom-loading-content-template>
|
||||
@@ -2029,7 +2027,7 @@ describe('DocumentListComponent rendering', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule, CustomTemplateComponent]
|
||||
imports: [NoopAuthModule, CustomTemplateComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(CustomTemplateComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
+3
-3
@@ -19,10 +19,10 @@ import { Subject } from 'rxjs';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { DataTableComponent, DataSorting, PaginationModel } from '@alfresco/adf-core';
|
||||
import { SearchService } from '../../../search/services/search.service';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { SimpleChange } from '@angular/core';
|
||||
import { SearchHeaderQueryBuilderService } from './../../../search/services/search-header-query-builder.service';
|
||||
import { FilterHeaderComponent } from './filter-header.component';
|
||||
import { provideRouter } from '@angular/router';
|
||||
|
||||
describe('FilterHeaderComponent', () => {
|
||||
let fixture: ComponentFixture<FilterHeaderComponent>;
|
||||
@@ -37,8 +37,8 @@ describe('FilterHeaderComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule, FilterHeaderComponent],
|
||||
providers: [{ provide: SearchService, useValue: searchMock }, DataTableComponent]
|
||||
imports: [FilterHeaderComponent],
|
||||
providers: [provideRouter([]), { provide: SearchService, useValue: searchMock }, DataTableComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(FilterHeaderComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
+1
-4
@@ -16,9 +16,7 @@
|
||||
*/
|
||||
|
||||
import { TestBed, ComponentFixture } from '@angular/core/testing';
|
||||
import { NO_ERRORS_SCHEMA, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { LibraryNameColumnComponent } from './library-name-column.component';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
|
||||
describe('LibraryNameColumnComponent', () => {
|
||||
let fixture: ComponentFixture<LibraryNameColumnComponent>;
|
||||
@@ -27,8 +25,7 @@ describe('LibraryNameColumnComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule, LibraryNameColumnComponent],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA]
|
||||
imports: [LibraryNameColumnComponent]
|
||||
});
|
||||
node = {
|
||||
id: 'nodeId',
|
||||
|
||||
+1
-4
@@ -17,8 +17,6 @@
|
||||
|
||||
import { LibraryRoleColumnComponent } from './library-role-column.component';
|
||||
import { TestBed, ComponentFixture } from '@angular/core/testing';
|
||||
import { NO_ERRORS_SCHEMA, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
|
||||
describe('LibraryRoleColumnComponent', () => {
|
||||
let fixture: ComponentFixture<LibraryRoleColumnComponent>;
|
||||
@@ -26,8 +24,7 @@ describe('LibraryRoleColumnComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule, LibraryRoleColumnComponent],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA]
|
||||
imports: [LibraryRoleColumnComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(LibraryRoleColumnComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
+1
-4
@@ -17,8 +17,6 @@
|
||||
|
||||
import { LibraryStatusColumnComponent } from './library-status-column.component';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { Site } from '@alfresco/js-api';
|
||||
|
||||
describe('LibraryStatusColumnComponent', () => {
|
||||
@@ -27,8 +25,7 @@ describe('LibraryStatusColumnComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule, LibraryStatusColumnComponent],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
imports: [LibraryStatusColumnComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(LibraryStatusColumnComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
+1
-2
@@ -17,7 +17,6 @@
|
||||
|
||||
import { NameColumnComponent } from './name-column.component';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { skip } from 'rxjs/operators';
|
||||
|
||||
describe('NameColumnComponent', () => {
|
||||
@@ -27,7 +26,7 @@ describe('NameColumnComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule, NameColumnComponent]
|
||||
imports: [NameColumnComponent]
|
||||
});
|
||||
|
||||
fixture = TestBed.createComponent(NameColumnComponent);
|
||||
|
||||
@@ -15,11 +15,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { DataColumn, DataRow, DataSorting, ThumbnailService } from '@alfresco/adf-core';
|
||||
import { DataColumn, DataRow, DataSorting, NoopAuthModule, ThumbnailService } from '@alfresco/adf-core';
|
||||
import { FileNode, FolderNode, SmartFolderNode, RuleFolderNode, LinkFolderNode } from './../../mock';
|
||||
import { ERR_OBJECT_NOT_FOUND, ShareDataRow } from './share-data-row.model';
|
||||
import { ERR_COL_NOT_FOUND, ERR_ROW_NOT_FOUND, ShareDataTableAdapter } from './share-datatable-adapter';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { ContentService } from '../../common/services/content.service';
|
||||
|
||||
@@ -29,7 +28,7 @@ describe('ShareDataTableAdapter', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule]
|
||||
imports: [NoopAuthModule]
|
||||
});
|
||||
const imageUrl: string = 'http://<addresss>';
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
import { CustomResourcesService } from './custom-resources.service';
|
||||
import { PaginationModel } from '@alfresco/adf-core';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import {
|
||||
Favorite,
|
||||
FavoritePaging,
|
||||
@@ -40,10 +39,6 @@ describe('CustomResourcesService', () => {
|
||||
let customResourcesService: CustomResourcesService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule]
|
||||
});
|
||||
|
||||
customResourcesService = TestBed.inject(CustomResourcesService);
|
||||
});
|
||||
|
||||
|
||||
+2
-2
@@ -21,8 +21,8 @@ import { DocumentActionsService } from './document-actions.service';
|
||||
import { DocumentListService } from './document-list.service';
|
||||
import { of } from 'rxjs';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { PermissionModel } from '../models/permissions.model';
|
||||
import { NoopAuthModule } from '@alfresco/adf-core';
|
||||
|
||||
describe('DocumentActionsService', () => {
|
||||
let service: DocumentActionsService;
|
||||
@@ -30,7 +30,7 @@ describe('DocumentActionsService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule]
|
||||
imports: [NoopAuthModule]
|
||||
});
|
||||
documentListService = TestBed.inject(DocumentListService);
|
||||
service = TestBed.inject(DocumentActionsService);
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
|
||||
import { DocumentListService } from './document-list.service';
|
||||
import { fakeAsync, TestBed } from '@angular/core/testing';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { of } from 'rxjs';
|
||||
import { NodeEntry, NodePaging } from '@alfresco/js-api';
|
||||
import { CustomResourcesService } from './custom-resources.service';
|
||||
import { NodesApiService } from '../../common';
|
||||
import { provideApiTesting } from '../../testing/providers';
|
||||
|
||||
declare let jasmine: any;
|
||||
|
||||
@@ -74,7 +74,7 @@ describe('DocumentListService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule]
|
||||
providers: [provideApiTesting()]
|
||||
});
|
||||
service = TestBed.inject(DocumentListService);
|
||||
customResourcesService = TestBed.inject(CustomResourcesService);
|
||||
|
||||
@@ -21,8 +21,8 @@ import { FileNode, FolderNode } from '../../mock';
|
||||
import { ContentActionHandler } from '../models/content-action.model';
|
||||
import { DocumentListService } from './document-list.service';
|
||||
import { FolderActionsService } from './folder-actions.service';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { PermissionModel } from '../models/permissions.model';
|
||||
import { NoopAuthModule } from '@alfresco/adf-core';
|
||||
|
||||
describe('FolderActionsService', () => {
|
||||
let service: FolderActionsService;
|
||||
@@ -30,7 +30,7 @@ describe('FolderActionsService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule]
|
||||
imports: [NoopAuthModule]
|
||||
});
|
||||
documentListService = TestBed.inject(DocumentListService);
|
||||
service = TestBed.inject(FolderActionsService);
|
||||
|
||||
@@ -22,8 +22,8 @@ import { NodeActionsService } from './node-actions.service';
|
||||
import { ContentNodeDialogService } from '../../content-node-selector/content-node-dialog.service';
|
||||
import { of, throwError } from 'rxjs';
|
||||
import { MatDialogRef } from '@angular/material/dialog';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { delay } from 'rxjs/operators';
|
||||
import { NoopAuthModule } from '@alfresco/adf-core';
|
||||
|
||||
const fakeNode: Node = {
|
||||
id: 'fake'
|
||||
@@ -39,7 +39,7 @@ describe('NodeActionsService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule],
|
||||
imports: [NoopAuthModule],
|
||||
providers: [{ provide: MatDialogRef, useValue: dialogRef }]
|
||||
});
|
||||
service = TestBed.inject(NodeActionsService);
|
||||
|
||||
@@ -22,8 +22,8 @@ import { By } from '@angular/platform-browser';
|
||||
import { Subject, of } from 'rxjs';
|
||||
import { FolderEditDirective } from './folder-edit.directive';
|
||||
import type { Node } from '@alfresco/js-api';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
import { ContentService } from '../common/services/content.service';
|
||||
import { NoopAuthModule } from '@alfresco/adf-core';
|
||||
|
||||
@Component({
|
||||
template: '<div [adf-edit-folder]="folder" (success)="success($event)" title="edit-title"></div>',
|
||||
@@ -31,7 +31,7 @@ import { ContentService } from '../common/services/content.service';
|
||||
imports: [FolderEditDirective]
|
||||
})
|
||||
class TestComponent {
|
||||
folder = {};
|
||||
folder: any = {};
|
||||
public successParameter: Node = null;
|
||||
|
||||
success(node: Node) {
|
||||
@@ -53,7 +53,7 @@ describe('FolderEditDirective', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule, TestComponent]
|
||||
imports: [NoopAuthModule, TestComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(TestComponent);
|
||||
element = fixture.debugElement.query(By.directive(FolderEditDirective));
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { ContentIncludeQuery, GroupEntry } from '@alfresco/js-api';
|
||||
import { GroupService } from './group.service';
|
||||
|
||||
@@ -27,9 +26,6 @@ describe('GroupService', () => {
|
||||
let opts: ContentIncludeQuery;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule]
|
||||
});
|
||||
service = TestBed.inject(GroupService);
|
||||
group = {
|
||||
entry: {
|
||||
|
||||
+1
-2
@@ -21,7 +21,6 @@ import { Component, OnInit } from '@angular/core';
|
||||
import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { from, Observable } from 'rxjs';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
import { InfiniteScrollDatasource } from './infinite-scroll-datasource';
|
||||
|
||||
class TestData {
|
||||
@@ -101,7 +100,7 @@ describe('InfiniteScrollDatasource', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule, ScrollingModule, TestComponent]
|
||||
imports: [ScrollingModule, TestComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(TestComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { LegalHoldService } from './legal-hold.service';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { BulkAssignHoldResponseEntry, Hold, HoldBulkStatusEntry, HoldEntry, HoldPaging, RequestQuery, SEARCH_LANGUAGE } from '@alfresco/js-api';
|
||||
|
||||
describe('LegalHoldsService', () => {
|
||||
@@ -53,9 +52,6 @@ describe('LegalHoldsService', () => {
|
||||
};
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule]
|
||||
});
|
||||
service = TestBed.inject(LegalHoldService);
|
||||
|
||||
legalHolds = {
|
||||
|
||||
+2
-2
@@ -18,11 +18,11 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||
import { mockFile, mockNode } from '../mock';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
import { NewVersionUploaderDataAction } from './models';
|
||||
import { NewVersionUploaderDialogComponent } from './new-version-uploader.dialog';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { VersionListComponent } from '../version-manager/version-list.component';
|
||||
import { NoopAuthModule } from '@alfresco/adf-core';
|
||||
|
||||
describe('NewVersionUploaderDialog', () => {
|
||||
let component: NewVersionUploaderDialogComponent;
|
||||
@@ -44,7 +44,7 @@ describe('NewVersionUploaderDialog', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule, NewVersionUploaderDialogComponent],
|
||||
imports: [NoopAuthModule, NewVersionUploaderDialogComponent],
|
||||
providers: [
|
||||
{ provide: MAT_DIALOG_DATA, useValue: { node: mockNode, showVersionsOnly, file: mockFile } },
|
||||
{
|
||||
|
||||
+1
-2
@@ -20,7 +20,6 @@ import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testin
|
||||
import { MatDialog, MatDialogConfig } from '@angular/material/dialog';
|
||||
import { BehaviorSubject, firstValueFrom, of, Subject } from 'rxjs';
|
||||
import { mockFile, mockNewVersionUploaderData, mockNode } from '../mock';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
import {
|
||||
NewVersionUploaderData,
|
||||
NewVersionUploaderDataAction,
|
||||
@@ -56,7 +55,7 @@ describe('NewVersionUploaderService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule, TestDialogComponent],
|
||||
imports: [TestDialogComponent],
|
||||
teardown: { destroyAfterEach: false }
|
||||
});
|
||||
|
||||
|
||||
@@ -20,17 +20,18 @@ import { NodeCommentsComponent } from './node-comments.component';
|
||||
import { CommentsComponent } from '../../../../core/src/lib/comments/comments.component';
|
||||
import { CommentModel } from '../../../../core/src/lib/models';
|
||||
import { UnitTestingUtils } from '../../../../core/src/lib/testing/unit-testing-utils';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
import { provideApiTesting } from '../testing/providers';
|
||||
|
||||
describe('NodeCommentsComponent', () => {
|
||||
let fixture: ComponentFixture<NodeCommentsComponent>;
|
||||
let component: NodeCommentsComponent;
|
||||
let testingUtils: UnitTestingUtils;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [NodeCommentsComponent, ContentTestingModule]
|
||||
}).compileComponents();
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [NodeCommentsComponent],
|
||||
providers: [provideApiTesting()]
|
||||
});
|
||||
|
||||
fixture = TestBed.createComponent(NodeCommentsComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
+1
-2
@@ -21,7 +21,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { Subject } from 'rxjs';
|
||||
import { AddPermissionPanelComponent } from './add-permission-panel.component';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { AddPermissionDialogComponent } from './add-permission-dialog.component';
|
||||
import { AddPermissionDialogData } from './add-permission-dialog-data.interface';
|
||||
import { fakeAuthorityResults } from '../../../mock/add-permission.component.mock';
|
||||
@@ -63,7 +62,7 @@ describe('AddPermissionDialog', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule, AddPermissionDialogComponent],
|
||||
imports: [AddPermissionDialogComponent],
|
||||
providers: [
|
||||
{ provide: MatDialogRef, useValue: dialogRef },
|
||||
{ provide: MAT_DIALOG_DATA, useValue: data }
|
||||
|
||||
+2
-2
@@ -20,13 +20,13 @@ import { AddPermissionPanelComponent } from './add-permission-panel.component';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { of } from 'rxjs';
|
||||
import { fakeAuthorityListResult, fakeNameListResult } from '../../../mock/add-permission.component.mock';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { SearchService } from '../../../search/services/search.service';
|
||||
import { DebugElement } from '@angular/core';
|
||||
import { HarnessLoader } from '@angular/cdk/testing';
|
||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
import { MatSelectionListHarness } from '@angular/material/list/testing';
|
||||
import { MatInputHarness } from '@angular/material/input/testing';
|
||||
import { MatIconTestingModule } from '@angular/material/icon/testing';
|
||||
|
||||
describe('AddPermissionPanelComponent', () => {
|
||||
let fixture: ComponentFixture<AddPermissionPanelComponent>;
|
||||
@@ -37,7 +37,7 @@ describe('AddPermissionPanelComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule, AddPermissionPanelComponent]
|
||||
imports: [MatIconTestingModule, AddPermissionPanelComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(AddPermissionPanelComponent);
|
||||
loader = TestbedHarnessEnvironment.loader(fixture);
|
||||
|
||||
+2
-2
@@ -23,7 +23,7 @@ import { By } from '@angular/platform-browser';
|
||||
import { of, throwError } from 'rxjs';
|
||||
import { fakeAuthorityResults } from '../../../mock/add-permission.component.mock';
|
||||
import { NodePermissionService } from '../../services/node-permission.service';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { NoopAuthModule } from '@alfresco/adf-core';
|
||||
|
||||
describe('AddPermissionComponent', () => {
|
||||
let fixture: ComponentFixture<AddPermissionComponent>;
|
||||
@@ -32,7 +32,7 @@ describe('AddPermissionComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule, AddPermissionComponent]
|
||||
imports: [NoopAuthModule, AddPermissionComponent]
|
||||
});
|
||||
nodePermissionService = TestBed.inject(NodePermissionService);
|
||||
const response: any = { node: { id: 'fake-node', allowableOperations: ['updatePermissions'] }, roles: [{ label: 'Test', role: 'test' }] };
|
||||
|
||||
+2
-2
@@ -17,11 +17,11 @@
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { of } from 'rxjs';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { NodesApiService } from '../../common/services/nodes-api.service';
|
||||
import { Component } from '@angular/core';
|
||||
import { InheritPermissionDirective } from './inherited-button.directive';
|
||||
import { NgIf } from '@angular/common';
|
||||
import { NoopAuthModule } from '@alfresco/adf-core';
|
||||
|
||||
const fakeNodeWithInherit: any = { id: 'fake-id', permissions: { isInheritanceEnabled: true }, allowableOperations: ['updatePermissions'] };
|
||||
const fakeNodeNoInherit: any = { id: 'fake-id', permissions: { isInheritanceEnabled: false }, allowableOperations: ['updatePermissions'] };
|
||||
@@ -55,7 +55,7 @@ describe('InheritPermissionDirective', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule, SimpleInheritedPermissionTestComponent]
|
||||
imports: [NoopAuthModule, SimpleInheritedPermissionTestComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(SimpleInheritedPermissionTestComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
-4
@@ -17,7 +17,6 @@
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { PermissionContainerComponent } from './permission-container.component';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { HarnessLoader } from '@angular/cdk/testing';
|
||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
import { MatSelectHarness } from '@angular/material/select/testing';
|
||||
@@ -30,9 +29,6 @@ describe('PermissionContainerComponent', () => {
|
||||
let element: HTMLElement;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule]
|
||||
});
|
||||
fixture = TestBed.createComponent(PermissionContainerComponent);
|
||||
component = fixture.componentInstance;
|
||||
element = fixture.nativeElement;
|
||||
|
||||
+5
-3
@@ -31,7 +31,6 @@ import {
|
||||
fakeSiteNodeResponse,
|
||||
fakeSiteRoles
|
||||
} from '../../../mock/permission-list.component.mock';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
import { NodesApiService } from '../../../common/services/nodes-api.service';
|
||||
import { HarnessLoader } from '@angular/cdk/testing';
|
||||
@@ -41,8 +40,11 @@ import { MatSelectHarness } from '@angular/material/select/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { MatSlideToggle } from '@angular/material/slide-toggle';
|
||||
import { ContentService } from '../../../common/services/content.service';
|
||||
import { AllowableOperationsEnum, NodePermissionsModel, PermissionContainerComponent } from '@alfresco/adf-content-services';
|
||||
import { DebugElement } from '@angular/core';
|
||||
import { AllowableOperationsEnum } from '../../../common';
|
||||
import { NodePermissionsModel } from '../../models/member.model';
|
||||
import { PermissionContainerComponent } from '../permission-container/permission-container.component';
|
||||
import { NoopAuthModule } from '@alfresco/adf-core';
|
||||
|
||||
describe('PermissionListComponent', () => {
|
||||
let loader: HarnessLoader;
|
||||
@@ -60,7 +62,7 @@ describe('PermissionListComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule]
|
||||
imports: [NoopAuthModule]
|
||||
});
|
||||
fixture = TestBed.createComponent(PermissionListComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
+2
-3
@@ -15,12 +15,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { NotificationService } from '@alfresco/adf-core';
|
||||
import { NoopAuthModule, NotificationService } from '@alfresco/adf-core';
|
||||
import { NodesApiService } from '../../../common/services/nodes-api.service';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { of, throwError } from 'rxjs';
|
||||
import { PermissionListService } from './permission-list.service';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { NodePermissionService } from '../../services/node-permission.service';
|
||||
import { fakeNodeInheritedOnly, fakeNodeLocalSiteManager, fakeNodeWithOnlyLocally } from '../../../mock/permission-list.component.mock';
|
||||
import { PermissionDisplayModel } from '../../models/permission.model';
|
||||
@@ -40,7 +39,7 @@ describe('PermissionListService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule]
|
||||
imports: [NoopAuthModule]
|
||||
});
|
||||
service = TestBed.inject(PermissionListService);
|
||||
nodePermissionService = TestBed.inject(NodePermissionService);
|
||||
|
||||
+2
-2
@@ -16,11 +16,11 @@
|
||||
*/
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { UserIconColumnComponent } from './user-icon-column.component';
|
||||
import { NodeEntry } from '@alfresco/js-api';
|
||||
import { UnitTestingUtils } from '@alfresco/adf-core';
|
||||
import { DebugElement } from '@angular/core';
|
||||
import { MatIconTestingModule } from '@angular/material/icon/testing';
|
||||
|
||||
describe('UserIconColumnComponent', () => {
|
||||
let fixture: ComponentFixture<UserIconColumnComponent>;
|
||||
@@ -41,7 +41,7 @@ describe('UserIconColumnComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule]
|
||||
imports: [MatIconTestingModule, UserIconColumnComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(UserIconColumnComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
+1
-2
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { UserNameColumnComponent } from './user-name-column.component';
|
||||
import { NodeEntry } from '@alfresco/js-api';
|
||||
|
||||
@@ -37,7 +36,7 @@ describe('UserNameColumnComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule]
|
||||
imports: [UserNameColumnComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(UserNameColumnComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
+1
-2
@@ -19,7 +19,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { UserRoleColumnComponent } from './user-role-column.component';
|
||||
import { RoleModel } from '../../models/role.model';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
|
||||
describe('UserRoleColumnComponent', () => {
|
||||
let component: UserRoleColumnComponent;
|
||||
@@ -27,7 +26,7 @@ describe('UserRoleColumnComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule, UserRoleColumnComponent]
|
||||
imports: [UserRoleColumnComponent]
|
||||
});
|
||||
|
||||
fixture = TestBed.createComponent(UserRoleColumnComponent);
|
||||
|
||||
+2
-2
@@ -19,9 +19,9 @@ import { TestBed } from '@angular/core/testing';
|
||||
import { NodePermissionDialogService } from './node-permission-dialog.service';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { of, Subject, throwError } from 'rxjs';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { NodePermissionService } from './node-permission.service';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
import { NoopAuthModule } from '@alfresco/adf-core';
|
||||
|
||||
describe('NodePermissionDialogService', () => {
|
||||
let service: NodePermissionDialogService;
|
||||
@@ -32,7 +32,7 @@ describe('NodePermissionDialogService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule]
|
||||
imports: [NoopAuthModule]
|
||||
});
|
||||
service = TestBed.inject(NodePermissionDialogService);
|
||||
materialDialog = TestBed.inject(MatDialog);
|
||||
|
||||
-4
@@ -29,7 +29,6 @@ import {
|
||||
fakeNodeWithoutSite
|
||||
} from '../../mock/permission-list.component.mock';
|
||||
import { fakeAuthorityResults } from '../../mock/add-permission.component.mock';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { NodesApiService } from '../../common/services/nodes-api.service';
|
||||
|
||||
describe('NodePermissionService', () => {
|
||||
@@ -55,9 +54,6 @@ describe('NodePermissionService', () => {
|
||||
];
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule]
|
||||
});
|
||||
service = TestBed.inject(NodePermissionService);
|
||||
searchApiService = TestBed.inject(SearchService);
|
||||
nodeService = TestBed.inject(NodesApiService);
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
import { PredictionService } from './prediction.service';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { Prediction, PredictionEntry, PredictionPaging, PredictionPagingList, ReviewStatus } from '@alfresco/js-api';
|
||||
|
||||
describe('PredictionService', () => {
|
||||
@@ -33,7 +32,7 @@ describe('PredictionService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule]
|
||||
imports: []
|
||||
});
|
||||
service = TestBed.inject(PredictionService);
|
||||
});
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { AiAnswerEntry, KnowledgeRetrievalConfigEntry, Node, QuestionModel, QuestionRequest } from '@alfresco/js-api';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { SearchAiService } from './search-ai.service';
|
||||
import { SearchAiInputState } from '../models/search-ai-input-state';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
@@ -27,7 +26,7 @@ describe('SearchAiService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule]
|
||||
imports: []
|
||||
});
|
||||
service = TestBed.inject(SearchAiService);
|
||||
});
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
|
||||
import { Component } from '@angular/core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { SearchFacetFiltersService } from '../services/search-facet-filters.service';
|
||||
import { SearchQueryBuilderService } from '../services/search-query-builder.service';
|
||||
import { ResetSearchDirective } from './reset-search.directive';
|
||||
import { provideRouter } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
template: `<button adf-reset-search>Reset</button>`,
|
||||
@@ -36,7 +36,8 @@ describe('Directive: ResetSearchDirective', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule, TestComponent]
|
||||
imports: [TestComponent],
|
||||
providers: [provideRouter([])]
|
||||
});
|
||||
fixture = TestBed.createComponent(TestComponent);
|
||||
searchFacetFiltersService = TestBed.inject(SearchFacetFiltersService);
|
||||
|
||||
+1
-2
@@ -17,7 +17,6 @@
|
||||
|
||||
import { SearchCheckListComponent, SearchListOption } from './search-check-list.component';
|
||||
import { SearchFilterList } from '../../models/search-filter-list.model';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { sizeOptions, stepOne, stepThree } from '../../../mock';
|
||||
import { HarnessLoader, TestKey } from '@angular/cdk/testing';
|
||||
@@ -35,7 +34,7 @@ describe('SearchCheckListComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule]
|
||||
imports: [SearchCheckListComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(SearchCheckListComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
+1
-2
@@ -19,7 +19,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { MatChipRemove } from '@angular/material/chips';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { Subject } from 'rxjs';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { SearchChipAutocompleteInputComponent } from './search-chip-autocomplete-input.component';
|
||||
import { DebugElement, SimpleChanges } from '@angular/core';
|
||||
import { HarnessLoader } from '@angular/cdk/testing';
|
||||
@@ -36,7 +35,7 @@ describe('SearchChipAutocompleteInputComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule, SearchChipAutocompleteInputComponent]
|
||||
imports: [SearchChipAutocompleteInputComponent]
|
||||
});
|
||||
|
||||
fixture = TestBed.createComponent(SearchChipAutocompleteInputComponent);
|
||||
|
||||
+3
-2
@@ -19,11 +19,11 @@ import { Component } from '@angular/core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { SearchFacetFiltersService } from '../../services/search-facet-filters.service';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { HarnessLoader } from '@angular/cdk/testing';
|
||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
import { MatChipHarness, MatChipRemoveHarness } from '@angular/material/chips/testing';
|
||||
import { SearchChipListComponent } from './search-chip-list.component';
|
||||
import { provideRouter } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-test-component',
|
||||
@@ -46,7 +46,8 @@ describe('SearchChipListComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule, TestComponent]
|
||||
imports: [TestComponent],
|
||||
providers: [provideRouter([])]
|
||||
});
|
||||
fixture = TestBed.createComponent(TestComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
@@ -18,12 +18,11 @@
|
||||
import { Component, DebugElement, ViewChild } from '@angular/core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { AuthenticationService, SearchTextInputComponent, UserPreferencesService } from '@alfresco/adf-core';
|
||||
import { AuthenticationService, NoopAuthModule, SearchTextInputComponent, UserPreferencesService } from '@alfresco/adf-core';
|
||||
import { noResult, results } from '../../mock';
|
||||
import { SearchControlComponent } from './search-control.component';
|
||||
import { SearchService } from '../services/search.service';
|
||||
import { of } from 'rxjs';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { EmptySearchResultComponent } from './empty-search-result.component';
|
||||
|
||||
@Component({
|
||||
@@ -62,7 +61,7 @@ describe('SearchControlComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule, SimpleSearchTestCustomEmptyComponent]
|
||||
imports: [NoopAuthModule, SimpleSearchTestCustomEmptyComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(SearchControlComponent);
|
||||
debugElement = fixture.debugElement;
|
||||
|
||||
+1
-2
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
||||
import { SearchDateRange } from './search-date-range/search-date-range';
|
||||
import { SearchFilterTabbedComponent } from '../search-filter-tabbed/search-filter-tabbed.component';
|
||||
@@ -64,7 +63,7 @@ describe('SearchDateRangeTabbedComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule, SearchFilterTabbedComponent, SearchDateRangeComponent, SearchDateRangeTabbedComponent],
|
||||
imports: [SearchFilterTabbedComponent, SearchDateRangeComponent, SearchDateRangeTabbedComponent],
|
||||
providers: [
|
||||
{ provide: SearchFilterTabbedComponent, useClass: MockSearchFilterTabbedComponent },
|
||||
{ provide: SearchDateRangeComponent, useClass: MockSearchDateRangeComponent }
|
||||
|
||||
+1
-2
@@ -17,7 +17,6 @@
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { ContentTestingModule } from '../../../../testing/content.testing.module';
|
||||
import { SearchDateRangeComponent } from './search-date-range.component';
|
||||
import { addDays, endOfToday, format, parse, startOfYesterday, subDays } from 'date-fns';
|
||||
import { Validators } from '@angular/forms';
|
||||
@@ -38,7 +37,7 @@ describe('SearchDateRangeComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule, SearchDateRangeComponent]
|
||||
imports: [SearchDateRangeComponent]
|
||||
});
|
||||
|
||||
fixture = TestBed.createComponent(SearchDateRangeComponent);
|
||||
|
||||
+1
-2
@@ -17,7 +17,6 @@
|
||||
|
||||
import { DEFAULT_DATETIME_FORMAT, SearchDatetimeRangeComponent } from './search-datetime-range.component';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { MatDatetimepickerInputEvent } from '@mat-datetimepicker/core';
|
||||
import { DateFnsUtils } from '@alfresco/adf-core';
|
||||
import { endOfMinute, isValid, startOfMinute } from 'date-fns';
|
||||
@@ -33,7 +32,7 @@ describe('SearchDatetimeRangeComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule, SearchDatetimeRangeComponent]
|
||||
imports: [SearchDatetimeRangeComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(SearchDatetimeRangeComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
+4
-5
@@ -19,10 +19,10 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { SearchFacetFieldComponent } from './search-facet-field.component';
|
||||
import { SearchFacetFiltersService } from '../../services/search-facet-filters.service';
|
||||
import { SearchQueryBuilderService } from '../../services/search-query-builder.service';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { FacetField } from '../../models/facet-field.interface';
|
||||
import { FacetFieldBucket } from '../../models/facet-field-bucket.interface';
|
||||
import { SearchFilterList } from '../../models/search-filter-list.model';
|
||||
import { provideRouter } from '@angular/router';
|
||||
|
||||
describe('SearchFacetFieldComponent', () => {
|
||||
let component: SearchFacetFieldComponent;
|
||||
@@ -30,15 +30,14 @@ describe('SearchFacetFieldComponent', () => {
|
||||
let searchFacetFiltersService: SearchFacetFiltersService;
|
||||
let queryBuilder: SearchQueryBuilderService;
|
||||
|
||||
beforeEach(async () => {
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule]
|
||||
imports: [SearchFacetFieldComponent],
|
||||
providers: [provideRouter([])]
|
||||
});
|
||||
searchFacetFiltersService = TestBed.inject(SearchFacetFiltersService);
|
||||
queryBuilder = TestBed.inject(SearchQueryBuilderService);
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(SearchFacetFieldComponent);
|
||||
component = fixture.componentInstance;
|
||||
spyOn(searchFacetFiltersService, 'updateSelectedBuckets').and.stub();
|
||||
|
||||
+1
-2
@@ -17,7 +17,6 @@
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { SearchFilterAutocompleteChipsComponent } from './search-filter-autocomplete-chips.component';
|
||||
import { EMPTY, of, ReplaySubject } from 'rxjs';
|
||||
import { AutocompleteField } from '../../models/autocomplete-option.interface';
|
||||
@@ -34,7 +33,7 @@ describe('SearchFilterAutocompleteChipsComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule, SearchFilterAutocompleteChipsComponent],
|
||||
imports: [SearchFilterAutocompleteChipsComponent],
|
||||
providers: [
|
||||
{
|
||||
provide: TagService,
|
||||
|
||||
+2
-5
@@ -16,17 +16,16 @@
|
||||
*/
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ContentTestingModule } from '../../../../testing/content.testing.module';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { SearchFilterList } from '../../../models/search-filter-list.model';
|
||||
import { SearchFacetChipTabbedComponent } from './search-facet-chip-tabbed.component';
|
||||
import { FacetField } from '../../../models/facet-field.interface';
|
||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { HarnessLoader, TestKey } from '@angular/cdk/testing';
|
||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
import { MatChipHarness } from '@angular/material/chips/testing';
|
||||
import { MatIconHarness } from '@angular/material/icon/testing';
|
||||
import { ConfigurableFocusTrapFactory } from '@angular/cdk/a11y';
|
||||
import { provideRouter } from '@angular/router';
|
||||
|
||||
describe('SearchFacetChipTabbedComponent', () => {
|
||||
let loader: HarnessLoader;
|
||||
@@ -38,9 +37,7 @@ describe('SearchFacetChipTabbedComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule],
|
||||
providers: [{ provide: ConfigurableFocusTrapFactory, useValue: focusTrapFactory }],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
providers: [provideRouter([]), { provide: ConfigurableFocusTrapFactory, useValue: focusTrapFactory }]
|
||||
});
|
||||
fixture = TestBed.createComponent(SearchFacetChipTabbedComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
+3
-4
@@ -16,16 +16,16 @@
|
||||
*/
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ContentTestingModule } from '../../../../testing/content.testing.module';
|
||||
import { SearchQueryBuilderService } from '../../../services/search-query-builder.service';
|
||||
import { SearchFilterList } from '../../../models/search-filter-list.model';
|
||||
import { FacetField } from '../../../models/facet-field.interface';
|
||||
import { SearchFacetFiltersService } from '../../../services/search-facet-filters.service';
|
||||
import { NO_ERRORS_SCHEMA, SimpleChange } from '@angular/core';
|
||||
import { SimpleChange } from '@angular/core';
|
||||
import { SearchFacetTabbedContentComponent } from './search-facet-tabbed-content.component';
|
||||
import { HarnessLoader } from '@angular/cdk/testing';
|
||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
import { MatTabGroupHarness, MatTabHarness } from '@angular/material/tabs/testing';
|
||||
import { provideRouter } from '@angular/router';
|
||||
|
||||
describe('SearchFacetTabbedContentComponent', () => {
|
||||
let component: SearchFacetTabbedContentComponent;
|
||||
@@ -37,8 +37,7 @@ describe('SearchFacetTabbedContentComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
providers: [provideRouter([])]
|
||||
});
|
||||
fixture = TestBed.createComponent(SearchFacetTabbedContentComponent);
|
||||
loader = TestbedHarnessEnvironment.loader(fixture);
|
||||
|
||||
+3
-2
@@ -17,7 +17,6 @@
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { SearchFacetChipComponent } from './search-facet-chip.component';
|
||||
import { ContentTestingModule } from '../../../../testing/content.testing.module';
|
||||
import { SearchQueryBuilderService } from '../../../services/search-query-builder.service';
|
||||
import { SearchFilterList } from '../../../models/search-filter-list.model';
|
||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
@@ -26,6 +25,7 @@ import { HarnessLoader, TestKey } from '@angular/cdk/testing';
|
||||
import { MatButtonHarness } from '@angular/material/button/testing';
|
||||
import { MatIconHarness } from '@angular/material/icon/testing';
|
||||
import { MatChipHarness } from '@angular/material/chips/testing';
|
||||
import { provideRouter } from '@angular/router';
|
||||
|
||||
describe('SearchFacetChipComponent', () => {
|
||||
let loader: HarnessLoader;
|
||||
@@ -35,7 +35,8 @@ describe('SearchFacetChipComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule]
|
||||
imports: [SearchFacetChipComponent],
|
||||
providers: [provideRouter([])]
|
||||
});
|
||||
fixture = TestBed.createComponent(SearchFacetChipComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
+3
-2
@@ -19,7 +19,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { SearchFilterChipsComponent } from './search-filter-chips.component';
|
||||
import { SearchFacetFiltersService } from '../../services/search-facet-filters.service';
|
||||
import { SearchQueryBuilderService } from '../../services/search-query-builder.service';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { SearchFacetFieldComponent } from '../search-facet-field/search-facet-field.component';
|
||||
import { SearchFilterList } from '../../models/search-filter-list.model';
|
||||
@@ -30,6 +29,7 @@ import { HarnessLoader } from '@angular/cdk/testing';
|
||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
import { MatCheckboxHarness } from '@angular/material/checkbox/testing';
|
||||
import { MatChipHarness } from '@angular/material/chips/testing';
|
||||
import { provideRouter } from '@angular/router';
|
||||
|
||||
describe('SearchFilterChipsComponent', () => {
|
||||
let fixture: ComponentFixture<SearchFilterChipsComponent>;
|
||||
@@ -40,7 +40,8 @@ describe('SearchFilterChipsComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule]
|
||||
imports: [SearchFilterChipsComponent],
|
||||
providers: [provideRouter([])]
|
||||
});
|
||||
queryBuilder = TestBed.inject(SearchQueryBuilderService);
|
||||
appConfigService = TestBed.inject(AppConfigService);
|
||||
|
||||
+1
-2
@@ -17,7 +17,6 @@
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { SearchFilterMenuCardComponent } from './search-filter-menu-card.component';
|
||||
import { ContentTestingModule } from '../../../../testing/content.testing.module';
|
||||
|
||||
describe('SearchFilterMenuComponent', () => {
|
||||
let component: SearchFilterMenuCardComponent;
|
||||
@@ -25,7 +24,7 @@ describe('SearchFilterMenuComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule]
|
||||
imports: [SearchFilterMenuCardComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(SearchFilterMenuCardComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
+3
-3
@@ -18,7 +18,6 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { SearchWidgetChipComponent } from './search-widget-chip.component';
|
||||
import { simpleCategories } from '../../../../mock';
|
||||
import { ContentTestingModule } from '../../../../testing/content.testing.module';
|
||||
import { MatMenuModule } from '@angular/material/menu';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { SearchQueryBuilderService } from '../../../services/search-query-builder.service';
|
||||
@@ -27,6 +26,7 @@ import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
import { MatChipHarness } from '@angular/material/chips/testing';
|
||||
import { MatIconHarness } from '@angular/material/icon/testing';
|
||||
import { ConfigurableFocusTrapFactory } from '@angular/cdk/a11y';
|
||||
import { provideRouter } from '@angular/router';
|
||||
|
||||
describe('SearchWidgetChipComponent', () => {
|
||||
let loader: HarnessLoader;
|
||||
@@ -39,8 +39,8 @@ describe('SearchWidgetChipComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [MatMenuModule, ContentTestingModule],
|
||||
providers: [{ provide: ConfigurableFocusTrapFactory, useValue: focusTrapFactory }]
|
||||
imports: [MatMenuModule, SearchWidgetChipComponent],
|
||||
providers: [provideRouter([]), { provide: ConfigurableFocusTrapFactory, useValue: focusTrapFactory }]
|
||||
});
|
||||
queryBuilder = TestBed.inject(SearchQueryBuilderService);
|
||||
fixture = TestBed.createComponent(SearchWidgetChipComponent);
|
||||
|
||||
+3
-3
@@ -19,7 +19,6 @@ import { Subject } from 'rxjs';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { SearchService } from '../../services/search.service';
|
||||
import { SearchHeaderQueryBuilderService } from '../../services/search-header-query-builder.service';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { SearchFilterContainerComponent } from './search-filter-container.component';
|
||||
import { SearchCategory } from '../../models/search-category.interface';
|
||||
@@ -29,6 +28,7 @@ import { MatMenuHarness } from '@angular/material/menu/testing';
|
||||
import { MatButtonHarness } from '@angular/material/button/testing';
|
||||
import { MatBadgeHarness } from '@angular/material/badge/testing';
|
||||
import { MatInputHarness } from '@angular/material/input/testing';
|
||||
import { provideRouter } from '@angular/router';
|
||||
|
||||
const mockCategory: SearchCategory = {
|
||||
id: 'queryName',
|
||||
@@ -58,8 +58,8 @@ describe('SearchFilterContainerComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule],
|
||||
providers: [{ provide: SearchService, useValue: searchMock }]
|
||||
imports: [SearchFilterContainerComponent],
|
||||
providers: [provideRouter([]), { provide: SearchService, useValue: searchMock }]
|
||||
});
|
||||
fixture = TestBed.createComponent(SearchFilterContainerComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
+3
-2
@@ -15,11 +15,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ContentTestingModule, SearchFilterTabbedComponent, SearchFilterTabDirective } from '@alfresco/adf-content-services';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { MatTabGroup } from '@angular/material/tabs';
|
||||
import { Component } from '@angular/core';
|
||||
import { SearchFilterTabbedComponent } from './search-filter-tabbed.component';
|
||||
import { SearchFilterTabDirective } from './search-filter-tab.directive';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-search-filter-tabbed-test',
|
||||
@@ -39,7 +40,7 @@ describe('SearchFilterTabbedComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [SearchFilterTabbedTestComponent, ContentTestingModule]
|
||||
imports: [SearchFilterTabbedTestComponent]
|
||||
});
|
||||
searchFilterTabbedTestFixture = TestBed.createComponent(SearchFilterTabbedTestComponent);
|
||||
});
|
||||
|
||||
+3
-2
@@ -16,8 +16,8 @@
|
||||
*/
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ContentTestingModule } from '../../../../testing/content.testing.module';
|
||||
import { SearchFilterCardComponent } from './search-filter-card.component';
|
||||
import { provideRouter } from '@angular/router';
|
||||
|
||||
describe('SearchFilterCardComponent', () => {
|
||||
let component: SearchFilterCardComponent;
|
||||
@@ -40,7 +40,8 @@ describe('SearchFilterCardComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule]
|
||||
imports: [SearchFilterCardComponent],
|
||||
providers: [provideRouter([])]
|
||||
});
|
||||
fixture = TestBed.createComponent(SearchFilterCardComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
+3
-3
@@ -23,7 +23,6 @@ import { Subject } from 'rxjs';
|
||||
import { SearchFilterList } from '../../models/search-filter-list.model';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import {
|
||||
disabledCategories,
|
||||
expandableCategories,
|
||||
@@ -45,6 +44,7 @@ import { MatExpansionPanelHarness } from '@angular/material/expansion/testing';
|
||||
import { MatCheckboxHarness } from '@angular/material/checkbox/testing';
|
||||
import { MatButtonHarness } from '@angular/material/button/testing';
|
||||
import { MatInputHarness } from '@angular/material/input/testing';
|
||||
import { provideRouter } from '@angular/router';
|
||||
|
||||
describe('SearchFilterComponent', () => {
|
||||
let loader: HarnessLoader;
|
||||
@@ -59,8 +59,8 @@ describe('SearchFilterComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule],
|
||||
providers: [{ provide: SearchService, useValue: searchMock }]
|
||||
imports: [SearchFilterComponent],
|
||||
providers: [provideRouter([]), { provide: SearchService, useValue: searchMock }]
|
||||
});
|
||||
searchFacetFiltersService = TestBed.inject(SearchFacetFiltersService);
|
||||
queryBuilder = TestBed.inject(SearchQueryBuilderService);
|
||||
|
||||
+3
-2
@@ -17,7 +17,6 @@
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { SearchFormComponent } from './search-form.component';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { SearchQueryBuilderService } from '../../services/search-query-builder.service';
|
||||
import { SearchForm } from '../../models/search-form.interface';
|
||||
import { By } from '@angular/platform-browser';
|
||||
@@ -25,6 +24,7 @@ import { HarnessLoader } from '@angular/cdk/testing';
|
||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
import { MatMenuHarness } from '@angular/material/menu/testing';
|
||||
import { MatButtonHarness } from '@angular/material/button/testing';
|
||||
import { provideRouter } from '@angular/router';
|
||||
|
||||
describe('SearchFormComponent', () => {
|
||||
let loader: HarnessLoader;
|
||||
@@ -39,7 +39,8 @@ describe('SearchFormComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule]
|
||||
imports: [SearchFormComponent],
|
||||
providers: [provideRouter([])]
|
||||
});
|
||||
fixture = TestBed.createComponent(SearchFormComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
+3
-3
@@ -15,13 +15,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { SearchConfiguration, SearchInputComponent } from '@alfresco/adf-content-services';
|
||||
import { AppConfigService } from '@alfresco/adf-core';
|
||||
import { HarnessLoader } from '@angular/cdk/testing';
|
||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { MatInputHarness } from '@angular/material/input/testing';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { SearchInputComponent } from './search-input.component';
|
||||
import { SearchConfiguration } from '../../models';
|
||||
|
||||
describe('SearchInputComponent', () => {
|
||||
let loader: HarnessLoader;
|
||||
@@ -45,7 +45,7 @@ describe('SearchInputComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule, SearchInputComponent]
|
||||
imports: [SearchInputComponent]
|
||||
});
|
||||
|
||||
fixture = TestBed.createComponent(SearchInputComponent);
|
||||
|
||||
+1
-2
@@ -17,7 +17,6 @@
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { LogicalSearchCondition, LogicalSearchFields, SearchLogicalFilterComponent } from './search-logical-filter.component';
|
||||
import { ReplaySubject } from 'rxjs';
|
||||
|
||||
@@ -27,7 +26,7 @@ describe('SearchLogicalFilterComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule, SearchLogicalFilterComponent]
|
||||
imports: [SearchLogicalFilterComponent]
|
||||
});
|
||||
|
||||
fixture = TestBed.createComponent(SearchLogicalFilterComponent);
|
||||
|
||||
+1
-2
@@ -19,7 +19,6 @@ import { ReplaySubject } from 'rxjs';
|
||||
import { SearchNumberRangeComponent } from './search-number-range.component';
|
||||
import { UntypedFormControl, UntypedFormGroup } from '@angular/forms';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
|
||||
describe('SearchNumberRangeComponent', () => {
|
||||
let component: SearchNumberRangeComponent;
|
||||
@@ -27,7 +26,7 @@ describe('SearchNumberRangeComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule, SearchNumberRangeComponent]
|
||||
imports: [SearchNumberRangeComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(SearchNumberRangeComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
+3
-2
@@ -15,12 +15,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { SearchPanelComponent } from './search-panel.component';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { ContentNodeSelectorPanelService } from '../../../content-node-selector';
|
||||
import { SearchCategory } from '../../models';
|
||||
import { provideRouter } from '@angular/router';
|
||||
|
||||
describe('SearchPanelComponent', () => {
|
||||
let fixture: ComponentFixture<SearchPanelComponent>;
|
||||
@@ -30,7 +30,8 @@ describe('SearchPanelComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule]
|
||||
imports: [SearchPanelComponent],
|
||||
providers: [provideRouter([])]
|
||||
});
|
||||
fixture = TestBed.createComponent(SearchPanelComponent);
|
||||
contentNodeSelectorPanelService = TestBed.inject(ContentNodeSelectorPanelService);
|
||||
|
||||
+2
-3
@@ -17,7 +17,6 @@
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { SearchPropertiesComponent } from './search-properties.component';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { MatOption } from '@angular/material/core';
|
||||
import { FileSizeUnit } from './file-size-unit.enum';
|
||||
@@ -61,8 +60,8 @@ describe('SearchPropertiesComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule, SearchPropertiesComponent]
|
||||
}).compileComponents();
|
||||
imports: [SearchPropertiesComponent]
|
||||
});
|
||||
|
||||
fixture = TestBed.createComponent(SearchPropertiesComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
+1
-2
@@ -18,7 +18,6 @@
|
||||
import { sizeOptions, stepOne, stepThree } from '../../../mock';
|
||||
import { SearchRadioComponent } from './search-radio.component';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { HarnessLoader } from '@angular/cdk/testing';
|
||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
import { MatRadioButtonHarness, MatRadioGroupHarness } from '@angular/material/radio/testing';
|
||||
@@ -31,7 +30,7 @@ describe('SearchRadioComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule]
|
||||
imports: [SearchRadioComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(SearchRadioComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
+1
-2
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
|
||||
import { SearchSliderComponent } from './search-slider.component';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ReplaySubject } from 'rxjs';
|
||||
|
||||
@@ -26,7 +25,7 @@ describe('SearchSliderComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule]
|
||||
imports: [SearchSliderComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(SearchSliderComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
+1
-2
@@ -18,7 +18,6 @@
|
||||
import { SearchSortingPickerComponent } from './search-sorting-picker.component';
|
||||
import { SearchQueryBuilderService } from '../../services/search-query-builder.service';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { SearchConfiguration } from '../../models';
|
||||
import { BaseQueryBuilderService } from '../../services/base-query-builder.service';
|
||||
|
||||
@@ -47,7 +46,7 @@ describe('SearchSortingPickerComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule],
|
||||
imports: [],
|
||||
providers: [
|
||||
{
|
||||
provide: SearchQueryBuilderService,
|
||||
|
||||
+1
-2
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
|
||||
import { SearchTextComponent } from './search-text.component';
|
||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { HarnessLoader } from '@angular/cdk/testing';
|
||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
@@ -31,7 +30,7 @@ describe('SearchTextComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule]
|
||||
imports: [SearchTextComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(SearchTextComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
@@ -19,7 +19,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { SearchService } from '../services/search.service';
|
||||
import { differentResult, result, SimpleSearchTestComponent } from '../../mock';
|
||||
import { of, throwError } from 'rxjs';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
|
||||
describe('SearchComponent', () => {
|
||||
let fixture: ComponentFixture<SimpleSearchTestComponent>;
|
||||
@@ -29,7 +28,7 @@ describe('SearchComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule, SimpleSearchTestComponent]
|
||||
imports: [SimpleSearchTestComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(SimpleSearchTestComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
@@ -18,11 +18,11 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { SearchFacetFiltersService } from './search-facet-filters.service';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { SearchQueryBuilderService } from './search-query-builder.service';
|
||||
import { EMPTY, of } from 'rxjs';
|
||||
import { CategoryService } from '../../category/services/category.service';
|
||||
import { FacetBucketSortBy, FacetBucketSortDirection } from '../models/facet-field.interface';
|
||||
import { provideRouter } from '@angular/router';
|
||||
|
||||
describe('SearchFacetFiltersService', () => {
|
||||
let searchFacetFiltersService: SearchFacetFiltersService;
|
||||
@@ -31,8 +31,8 @@ describe('SearchFacetFiltersService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule],
|
||||
providers: [
|
||||
provideRouter([]),
|
||||
{
|
||||
provide: CategoryService,
|
||||
useValue: {
|
||||
|
||||
+2
-3
@@ -19,9 +19,8 @@ import { SearchConfiguration } from '../models/search-configuration.interface';
|
||||
import { AppConfigService } from '@alfresco/adf-core';
|
||||
import { SearchHeaderQueryBuilderService } from './search-header-query-builder.service';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { AlfrescoApiService } from '../../services/alfresco-api.service';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { ActivatedRoute, provideRouter, Router } from '@angular/router';
|
||||
import { SearchCategory } from '../models';
|
||||
|
||||
describe('SearchHeaderQueryBuilderService', () => {
|
||||
@@ -31,7 +30,7 @@ describe('SearchHeaderQueryBuilderService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule]
|
||||
providers: [provideRouter([])]
|
||||
});
|
||||
router = TestBed.inject(Router);
|
||||
activatedRoute = TestBed.inject(ActivatedRoute);
|
||||
|
||||
@@ -21,9 +21,8 @@ import { AppConfigService } from '@alfresco/adf-core';
|
||||
import { AlfrescoApiService } from '../../services/alfresco-api.service';
|
||||
import { FacetField } from '../models/facet-field.interface';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { ADF_SEARCH_CONFIGURATION } from '../search-configuration.token';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { ActivatedRoute, provideRouter, Router } from '@angular/router';
|
||||
import { skip } from 'rxjs/operators';
|
||||
|
||||
const buildConfig = (searchSettings = {}): AppConfigService => {
|
||||
@@ -40,8 +39,7 @@ describe('SearchQueryBuilder (runtime config)', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule],
|
||||
providers: [{ provide: ADF_SEARCH_CONFIGURATION, useValue: runtimeConfig }]
|
||||
providers: [provideRouter([]), { provide: ADF_SEARCH_CONFIGURATION, useValue: runtimeConfig }]
|
||||
});
|
||||
});
|
||||
|
||||
@@ -79,7 +77,7 @@ describe('SearchQueryBuilder', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule]
|
||||
providers: [provideRouter([])]
|
||||
});
|
||||
router = TestBed.inject(Router);
|
||||
activatedRoute = TestBed.inject(ActivatedRoute);
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
import { AppConfigService, UserPreferencesService } from '@alfresco/adf-core';
|
||||
import { TagService } from './tag.service';
|
||||
import { fakeAsync, TestBed, tick } from '@angular/core/testing';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { firstValueFrom, throwError } from 'rxjs';
|
||||
import { Pagination, Tag, TagBody, TagEntry, TagPaging, TagPagingList } from '@alfresco/js-api';
|
||||
|
||||
@@ -40,9 +39,6 @@ describe('TagService', () => {
|
||||
};
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule]
|
||||
});
|
||||
service = TestBed.inject(TagService);
|
||||
userPreferencesService = TestBed.inject(UserPreferencesService);
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { TagActionsComponent } from './tag-actions.component';
|
||||
import { TagService } from '../services/tag.service';
|
||||
import { of } from 'rxjs';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
|
||||
describe('TagActionsComponent', () => {
|
||||
const dataTag = {
|
||||
@@ -50,7 +49,7 @@ describe('TagActionsComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule, TagActionsComponent]
|
||||
imports: [TagActionsComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(TagActionsComponent);
|
||||
tagService = TestBed.inject(TagService);
|
||||
|
||||
@@ -19,7 +19,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { TagService } from '../services/tag.service';
|
||||
import { TagListComponent } from './tag-list.component';
|
||||
import { of } from 'rxjs';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
|
||||
describe('TagList', () => {
|
||||
const dataTag = {
|
||||
@@ -50,7 +49,7 @@ describe('TagList', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule, TagListComponent]
|
||||
imports: [TagListComponent]
|
||||
});
|
||||
|
||||
tagService = TestBed.inject(TagService);
|
||||
|
||||
@@ -19,7 +19,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { TagNodeListComponent } from './tag-node-list.component';
|
||||
import { TagService } from '../services/tag.service';
|
||||
import { Observable, of, Subject } from 'rxjs';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { Tag, TagEntry, TagPaging } from '@alfresco/js-api';
|
||||
import { DynamicChipListComponent } from '@alfresco/adf-core';
|
||||
import { By } from '@angular/platform-browser';
|
||||
@@ -30,7 +29,7 @@ describe('TagNodeList', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule, TagNodeListComponent]
|
||||
imports: [TagNodeListComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(TagNodeListComponent);
|
||||
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