mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
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:
committed by
Eugenio Romano
parent
9fbfcfa96e
commit
382ea3c1b3
@@ -15,14 +15,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { NgZone, SimpleChange, Component } from '@angular/core';
|
||||
import { SimpleChange, Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { MatProgressSpinnerModule } from '@angular/material';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { ProcessContentService } from '@alfresco/adf-core';
|
||||
import { ProcessContentService, setupTestBed } from '@alfresco/adf-core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { ProcessAttachmentListComponent } from './process-attachment-list.component';
|
||||
import { ProcessTestingModule } from '../testing/process.testing.module';
|
||||
|
||||
describe('ProcessAttachmentListComponent', () => {
|
||||
|
||||
@@ -32,21 +31,9 @@ describe('ProcessAttachmentListComponent', () => {
|
||||
let getProcessRelatedContentSpy: jasmine.Spy;
|
||||
let mockAttachment: any;
|
||||
|
||||
beforeEach(async(() => {
|
||||
let zone = new NgZone({enableLongStackTrace: false});
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
MatProgressSpinnerModule
|
||||
],
|
||||
declarations: [
|
||||
ProcessAttachmentListComponent
|
||||
],
|
||||
providers: [
|
||||
ProcessContentService,
|
||||
{ provide: NgZone, useValue: zone }
|
||||
]
|
||||
}).compileComponents();
|
||||
}));
|
||||
setupTestBed({
|
||||
imports: [ProcessTestingModule]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -54,11 +41,6 @@ describe('ProcessAttachmentListComponent', () => {
|
||||
component = fixture.componentInstance;
|
||||
service = fixture.debugElement.injector.get(ProcessContentService);
|
||||
|
||||
const translateService: TranslateService = TestBed.get(TranslateService);
|
||||
spyOn(translateService, 'get').and.callFake((key) => {
|
||||
return Observable.of(key);
|
||||
});
|
||||
|
||||
mockAttachment = {
|
||||
size: 2,
|
||||
total: 2,
|
||||
@@ -161,7 +143,7 @@ describe('ProcessAttachmentListComponent', () => {
|
||||
});
|
||||
}));
|
||||
|
||||
it('should display all actions if attachements are not read only', async(() => {
|
||||
it('should display all actions if attachments are not read only', async(() => {
|
||||
let change = new SimpleChange(null, '123', true);
|
||||
component.ngOnChanges({ 'processInstanceId': change });
|
||||
|
||||
@@ -317,16 +299,11 @@ class CustomEmptyTemplateComponent {
|
||||
describe('Custom CustomEmptyTemplateComponent', () => {
|
||||
let fixture: ComponentFixture<CustomEmptyTemplateComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [
|
||||
ProcessAttachmentListComponent,
|
||||
CustomEmptyTemplateComponent
|
||||
],
|
||||
imports: [
|
||||
]
|
||||
}).compileComponents();
|
||||
}));
|
||||
setupTestBed({
|
||||
imports: [ProcessTestingModule],
|
||||
declarations: [CustomEmptyTemplateComponent],
|
||||
schemas: [ CUSTOM_ELEMENTS_SCHEMA ]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(CustomEmptyTemplateComponent);
|
||||
|
Reference in New Issue
Block a user