mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +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
@@ -16,14 +16,13 @@
|
||||
*/
|
||||
|
||||
import { CUSTOM_ELEMENTS_SCHEMA, SimpleChange } from '@angular/core';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { PathElementEntity } from 'alfresco-js-api';
|
||||
import { DataTableModule } from '@alfresco/adf-core';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { fakeNodeWithCreatePermission } from '../mock';
|
||||
import { CustomResourcesService, DocumentListService, DocumentListComponent } from '../document-list';
|
||||
import { DocumentListComponent } from '../document-list';
|
||||
import { BreadcrumbComponent } from './breadcrumb.component';
|
||||
|
||||
declare let jasmine: any;
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
|
||||
describe('Breadcrumb', () => {
|
||||
|
||||
@@ -31,33 +30,21 @@ describe('Breadcrumb', () => {
|
||||
let fixture: ComponentFixture<BreadcrumbComponent>;
|
||||
let documentList: DocumentListComponent;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
DataTableModule
|
||||
],
|
||||
declarations: [
|
||||
DocumentListComponent,
|
||||
BreadcrumbComponent
|
||||
],
|
||||
providers: [
|
||||
DocumentListService,
|
||||
CustomResourcesService
|
||||
],
|
||||
schemas: [
|
||||
CUSTOM_ELEMENTS_SCHEMA
|
||||
]
|
||||
}).compileComponents();
|
||||
}));
|
||||
setupTestBed({
|
||||
imports: [ContentTestingModule],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(BreadcrumbComponent);
|
||||
|
||||
component = fixture.componentInstance;
|
||||
|
||||
documentList = TestBed.createComponent<DocumentListComponent>(DocumentListComponent).componentInstance;
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
fixture.destroy();
|
||||
});
|
||||
|
||||
it('should prevent default click behavior', () => {
|
||||
let event = jasmine.createSpyObj('event', ['preventDefault']);
|
||||
component.onRoutePathClick(null, event);
|
||||
|
@@ -18,10 +18,11 @@
|
||||
import { CUSTOM_ELEMENTS_SCHEMA, SimpleChange } from '@angular/core';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { DataTableModule } from '@alfresco/adf-core';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { fakeNodeWithCreatePermission } from '../mock';
|
||||
import { CustomResourcesService, DocumentListComponent, DocumentListService } from '../document-list';
|
||||
import { DocumentListComponent } from '../document-list';
|
||||
import { DropdownBreadcrumbComponent } from './dropdown-breadcrumb.component';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
|
||||
describe('DropdownBreadcrumb', () => {
|
||||
|
||||
@@ -29,32 +30,21 @@ describe('DropdownBreadcrumb', () => {
|
||||
let fixture: ComponentFixture<DropdownBreadcrumbComponent>;
|
||||
let documentList: DocumentListComponent;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
DataTableModule
|
||||
],
|
||||
declarations: [
|
||||
DocumentListComponent,
|
||||
DropdownBreadcrumbComponent
|
||||
],
|
||||
providers: [
|
||||
DocumentListService,
|
||||
CustomResourcesService
|
||||
],
|
||||
schemas: [
|
||||
CUSTOM_ELEMENTS_SCHEMA
|
||||
]
|
||||
}).compileComponents();
|
||||
}));
|
||||
setupTestBed({
|
||||
imports: [ContentTestingModule],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(DropdownBreadcrumbComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
documentList = TestBed.createComponent<DocumentListComponent>(DocumentListComponent).componentInstance;
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
fixture.destroy();
|
||||
});
|
||||
|
||||
function openSelect() {
|
||||
const folderIcon = fixture.debugElement.query(By.css('[data-automation-id="dropdown-breadcrumb-trigger"]'));
|
||||
folderIcon.triggerEventHandler('click', null);
|
||||
|
Reference in New Issue
Block a user