mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
[ACS-7365] Optimise Search providers and unit tests (#9477)
refactor: optimise node selector imports and tests
This commit is contained in:
@@ -17,7 +17,6 @@
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { VersionComparisonComponent } from './version-comparison.component';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
@@ -52,10 +51,7 @@ describe('VersionComparisonComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
imports: [ContentTestingModule],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
});
|
||||
fixture = TestBed.createComponent(VersionComparisonComponent);
|
||||
|
||||
@@ -23,7 +23,6 @@ import { MatDialog } from '@angular/material/dialog';
|
||||
import { of } from 'rxjs';
|
||||
import { Node, NodeEntry, VersionEntry, Version } from '@alfresco/js-api';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { ContentVersionService } from './content-version.service';
|
||||
import { take } from 'rxjs/operators';
|
||||
|
||||
@@ -48,7 +47,7 @@ describe('VersionListComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [TranslateModule.forRoot(), ContentTestingModule],
|
||||
imports: [ContentTestingModule],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
});
|
||||
fixture = TestBed.createComponent(VersionListComponent);
|
||||
|
||||
@@ -21,7 +21,6 @@ import { By } from '@angular/platform-browser';
|
||||
import { Node, Version, VersionEntry, VersionPaging } from '@alfresco/js-api';
|
||||
import { VersionManagerComponent } from './version-manager.component';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { NodesApiService } from '../common/services/nodes-api.service';
|
||||
|
||||
describe('VersionManagerComponent', () => {
|
||||
@@ -40,7 +39,7 @@ describe('VersionManagerComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [TranslateModule.forRoot(), ContentTestingModule],
|
||||
imports: [ContentTestingModule],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
});
|
||||
fixture = TestBed.createComponent(VersionManagerComponent);
|
||||
@@ -86,7 +85,7 @@ describe('VersionManagerComponent', () => {
|
||||
|
||||
const emittedData = { value: { entry: node } };
|
||||
let lastValue: Node;
|
||||
component.uploadSuccess.subscribe((event) => lastValue = event);
|
||||
component.uploadSuccess.subscribe((event) => (lastValue = event));
|
||||
component.onUploadSuccess(emittedData);
|
||||
expect(lastValue).toBe(node);
|
||||
});
|
||||
@@ -95,7 +94,7 @@ describe('VersionManagerComponent', () => {
|
||||
fixture.detectChanges();
|
||||
|
||||
let lastValue: Node;
|
||||
nodesApiService.nodeUpdated.subscribe((res) => lastValue = res);
|
||||
nodesApiService.nodeUpdated.subscribe((res) => (lastValue = res));
|
||||
|
||||
const emittedData = { value: { entry: node } };
|
||||
component.onUploadSuccess(emittedData);
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { VersionUploadComponent } from './version-upload.component';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
@@ -49,10 +48,7 @@ describe('VersionUploadComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ContentTestingModule
|
||||
],
|
||||
imports: [ContentTestingModule],
|
||||
providers: [UploadService],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user