136. Adding router outlet (#17)
This commit is contained in:
@ -1,9 +1,13 @@
|
||||
import {TestBed} from '@angular/core/testing';
|
||||
import {AppComponent} from './app.component';
|
||||
import {RouterTestingModule} from "@angular/router/testing";
|
||||
import {By} from "@angular/platform-browser";
|
||||
import {RouterOutlet} from "@angular/router";
|
||||
|
||||
describe('AppComponent', () => {
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [RouterTestingModule.withRoutes([])],
|
||||
declarations: [
|
||||
AppComponent
|
||||
],
|
||||
@ -22,10 +26,11 @@ describe('AppComponent', () => {
|
||||
expect(app.title).toEqual('support-portal-frontend');
|
||||
});
|
||||
|
||||
it('should render title', () => {
|
||||
it('should have a router outlet', () => {
|
||||
const fixture = TestBed.createComponent(AppComponent);
|
||||
fixture.detectChanges();
|
||||
const compiled = fixture.nativeElement as HTMLElement;
|
||||
expect(compiled.querySelector('.content span')?.textContent).toContain('support-portal-frontend app is running!');
|
||||
|
||||
let debugElement = fixture.debugElement.query(By.directive(RouterOutlet));
|
||||
expect(debugElement).not.toBeNull();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user