Added testing utils functions

This commit is contained in:
Giuseppe Digilio
2018-07-11 18:42:45 +02:00
parent 10144971f9
commit 683c2f2f6b
13 changed files with 55 additions and 120 deletions

View File

@@ -44,16 +44,7 @@ import { EnumKeysPipe } from '../utils/enum-keys-pipe';
import { SortDirection, SortOptions } from '../../core/cache/models/sort-options.model';
import { GLOBAL_CONFIG, ENV_CONFIG } from '../../../config';
function createTestComponent<T>(html: string, type: { new(...args: any[]): T }): ComponentFixture<T> {
TestBed.overrideComponent(type, {
set: { template: html }
});
const fixture = TestBed.createComponent(type);
fixture.detectChanges();
return fixture as ComponentFixture<T>;
}
import { createTestComponent } from '../testing/utils';
function expectPages(fixture: ComponentFixture<any>, pagesDef: string[]): void {
const de = fixture.debugElement.query(By.css('.pagination'));