Angular src restructured as modular as per angular official guidelines, .travis.yml support added for node 12
This commit is contained in:
33
src/app/home/home.component.spec.ts
Normal file
33
src/app/home/home.component.spec.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { HomeComponent } from './home.component';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
describe('HomeComponent', () => {
|
||||
let component: HomeComponent;
|
||||
let fixture: ComponentFixture<HomeComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [HomeComponent],
|
||||
imports: [TranslateModule.forRoot()]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(HomeComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should render title in a h1 tag', async(() => {
|
||||
const compiled = fixture.debugElement.nativeElement;
|
||||
expect(compiled.querySelector('h1').textContent).toContain(
|
||||
'PAGES.HOME.TITLE'
|
||||
);
|
||||
}));
|
||||
});
|
||||
Reference in New Issue
Block a user