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

@@ -17,15 +17,15 @@
import { Component, SimpleChange, ViewChild } from '@angular/core';
import { async, ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
import { MatProgressSpinnerModule } from '@angular/material';
import { Observable } from 'rxjs/Observable';
import { ProcessInstanceListComponent } from './process-list.component';
import { AppConfigService } from '@alfresco/adf-core';
import { AppConfigService, setupTestBed, CoreModule } from '@alfresco/adf-core';
import { DataRowEvent, DataSorting, ObjectDataRow, ObjectDataTableAdapter } from '@alfresco/adf-core';
import { fakeProcessInstance, fakeProcessInstancesWithNoName } from '../../mock';
import { ProcessService } from '../services/process.service';
import { ProcessTestingModule } from '../../testing/process.testing.module';
describe('ProcessInstanceListComponent', () => {
@@ -68,45 +68,37 @@ describe('ProcessInstanceListComponent', () => {
]
, fakeCutomSchema };
setupTestBed({
imports: [
ProcessTestingModule
]
});
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
MatProgressSpinnerModule
],
declarations: [ ProcessInstanceListComponent ],
providers: [
ProcessService
]
}).compileComponents().then(() => {
fixture = TestBed.createComponent(ProcessInstanceListComponent);
component = fixture.componentInstance;
appConfig = TestBed.get(AppConfigService);
service = fixture.debugElement.injector.get(ProcessService);
fixture = TestBed.createComponent(ProcessInstanceListComponent);
component = fixture.componentInstance;
appConfig = TestBed.get(AppConfigService);
service = TestBed.get(ProcessService);
getProcessInstancesSpy = spyOn(service, 'getProcessInstances').and.returnValue(Observable.of(fakeProcessInstance));
appConfig.config = Object.assign(appConfig.config, {
'adf-process-list': {
'presets': {
'fakeCutomSchema': [
{
'key': 'fakeName',
'type': 'text',
'title': 'ADF_PROCESS_LIST.PROPERTIES.FAKE',
'sortable': true
},
{
'key': 'fakeProcessName',
'type': 'text',
'title': 'ADF_PROCESS_LIST.PROPERTIES.PROCESS_FAKE',
'sortable': true
}
]
getProcessInstancesSpy = spyOn(service, 'getProcessInstances').and.returnValue(Observable.of(fakeProcessInstance));
appConfig.config['adf-process-list'] = {
'presets': {
'fakeCutomSchema': [
{
'key': 'fakeName',
'type': 'text',
'title': 'ADF_PROCESS_LIST.PROPERTIES.FAKE',
'sortable': true
},
{
'key': 'fakeProcessName',
'type': 'text',
'title': 'ADF_PROCESS_LIST.PROPERTIES.PROCESS_FAKE',
'sortable': true
}
}
]
}
);
});
};
}));
it('should use the default schemaColumn as default', () => {
@@ -530,17 +522,11 @@ describe('CustomProcessListComponent', () => {
let fixture: ComponentFixture<CustomProcessListComponent>;
let component: CustomProcessListComponent;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [
ProcessInstanceListComponent,
CustomProcessListComponent
],
providers: [
ProcessService
]
}).compileComponents();
}));
setupTestBed({
imports: [CoreModule.forRoot()],
declarations: [ProcessInstanceListComponent, CustomProcessListComponent],
providers: [ProcessService]
});
beforeEach(() => {
fixture = TestBed.createComponent(CustomProcessListComponent);