unit test performance (#3194)

* DataTable (-4 sec)

* PaginationComponent (-1 sec)

* DocumentList

* custom testbed setup, test upgrades

* test fixes

* more test fixes

* remove fdescribe

* test fixes

* test fixes

* more test fixes

* test fixes

* upgrade tests

* update tests

* upgrade tests

* upgrade tests

* upgrade tests

* upgrade tests

* update tests

* translate loader fixes

* auth and cookie fixes

* upgrade tests

* upgrade tests

* test fixes

* almost there

* diable broken tests

* process tests (part 1)

* fix lint issues

* another test upgrade

* almost there

* cleanup

* insights testing upgrade

* improve tests

* tests cleanup

* tests cleanup

* cleanup tests

* test cleanup

* favorite nodes tests

* rebase fix syntax

* fix core test

* give up test focus

* flush tabs

* fix search test

* Update document-list.component.spec.ts

* fix document list lock

* increase tick time

* remove duplicate test
This commit is contained in:
Denys Vuika
2018-04-23 09:55:22 +01:00
committed by Eugenio Romano
parent 9fbfcfa96e
commit 382ea3c1b3
204 changed files with 3093 additions and 4389 deletions

View File

@@ -19,21 +19,16 @@ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, fakeAsync, tick, ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { MinimalNodeEntryEntity, SiteEntry, SitePaging } from 'alfresco-js-api';
import { SearchService, SitesService } from '@alfresco/adf-core';
import { DataTableModule } from '@alfresco/adf-core';
import { SearchService, SitesService, setupTestBed } from '@alfresco/adf-core';
import { Observable } from 'rxjs/Observable';
import { Observer } from 'rxjs/Observer';
import {
CustomResourcesService,
EmptyFolderContentDirective,
DocumentListComponent,
DocumentListService
} from '../document-list';
import { DropdownSitesComponent } from '../site-dropdown';
import { DropdownBreadcrumbComponent } from '../breadcrumb';
import { ContentNodeSelectorPanelComponent } from './content-node-selector-panel.component';
import { ContentNodeSelectorService } from './content-node-selector.service';
import { NodePaging } from 'alfresco-js-api';
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';
const ONE_FOLDER_RESULT = {
list: {
@@ -74,37 +69,13 @@ describe('ContentNodeSelectorComponent', () => {
_observer.next(result);
}
afterEach(() => {
fixture.destroy();
TestBed.resetTestingModule();
setupTestBed({
imports: [ContentTestingModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
});
describe('General component features', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
DataTableModule
],
declarations: [
DocumentListComponent,
EmptyFolderContentDirective,
DropdownSitesComponent,
DropdownBreadcrumbComponent,
ContentNodeSelectorPanelComponent
],
providers: [
CustomResourcesService,
SearchService,
DocumentListService,
SitesService,
ContentNodeSelectorService
],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
});
TestBed.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ContentNodeSelectorPanelComponent);
component = fixture.componentInstance;
@@ -120,6 +91,10 @@ describe('ContentNodeSelectorComponent', () => {
});
});
afterEach(() => {
fixture.destroy();
});
describe('Parameters', () => {
it('should trigger the select event when selection has been made', (done) => {
@@ -518,7 +493,7 @@ describe('ContentNodeSelectorComponent', () => {
expect(component.searchTerm).toBe('');
expect(component.folderIdToShow).toBe('namek');
});
}));
it('should show the current folder\'s content instead of search results if search was not performed', () => {
let documentList = fixture.debugElement.query(By.directive(DocumentListComponent));