ref/ make app reloading/working with and without usehash routing strategy
This commit is contained in:
35
src/app/detail/detail.component.spec.ts
Normal file
35
src/app/detail/detail.component.spec.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { DetailComponent } from './detail.component';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
|
||||
describe('DetailComponent', () => {
|
||||
let component: DetailComponent;
|
||||
let fixture: ComponentFixture<DetailComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [DetailComponent],
|
||||
imports: [TranslateModule.forRoot(), RouterTestingModule]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(DetailComponent);
|
||||
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.DETAIL.TITLE'
|
||||
);
|
||||
}));
|
||||
});
|
||||
Reference in New Issue
Block a user