test issue

This commit is contained in:
Giuseppe Digilio
2017-01-13 18:37:35 +01:00
parent c31a0c927f
commit 28fd92b9f7
2 changed files with 111 additions and 5 deletions

View File

@@ -9,6 +9,7 @@ import {
CUSTOM_ELEMENTS_SCHEMA,
DebugElement
} from "@angular/core";
import { By } from '@angular/platform-browser';
import { TranslateModule } from "ng2-translate";
import { NgbCollapseModule } from '@ng-bootstrap/ng-bootstrap';
import { Store } from "@ngrx/store";
@@ -28,7 +29,7 @@ let el: HTMLElement;
describe('App component', () => {
beforeEach(() => {
beforeEach(async(() => {
return TestBed.configureTestingModule({
imports: [ CommonModule, TranslateModule.forRoot(), NgbCollapseModule.forRoot()],
declarations: [ AppComponent, HeaderComponent ], // declare the test component
@@ -40,10 +41,18 @@ describe('App component', () => {
}
],
schemas: [ CUSTOM_ELEMENTS_SCHEMA ]
}).compileComponents().then(() => {
fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
});
})
}));
// synchronous beforeEach
beforeEach(() => {
fixture = TestBed.createComponent(AppComponent);
comp = fixture.componentInstance; // BannerComponent test instance
// query for the title <p> by CSS element selector
de = fixture.debugElement.query(By.css('p'));
el = de.nativeElement;
});
it('should create component', inject([AppComponent], (app: AppComponent) => {