Ng not ejected anymore
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { HomeComponent } from './home.component';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
describe('HomeComponent', () => {
|
||||
let component: HomeComponent;
|
||||
@@ -8,7 +9,10 @@ describe('HomeComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ HomeComponent ]
|
||||
declarations: [ HomeComponent ],
|
||||
imports: [
|
||||
TranslateModule.forRoot()
|
||||
]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
@@ -23,16 +27,8 @@ describe('HomeComponent', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
|
||||
it(`should have as title 'App works !'`, async(() => {
|
||||
fixture = TestBed.createComponent(HomeComponent);
|
||||
const app = fixture.debugElement.componentInstance;
|
||||
expect(app.title).toEqual('App works !');
|
||||
}));
|
||||
|
||||
it('should render title in a h1 tag', async(() => {
|
||||
fixture = TestBed.createComponent(HomeComponent);
|
||||
fixture.detectChanges();
|
||||
const compiled = fixture.debugElement.nativeElement;
|
||||
expect(compiled.querySelector('h1').textContent).toContain('App works !');
|
||||
expect(compiled.querySelector('h1').textContent).toBeTruthy();
|
||||
}));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user