136. Adding router outlet (#17)

This commit is contained in:
Art
2021-09-17 17:50:26 +03:00
parent 5e1159711b
commit 6f3971ea45
2 changed files with 9 additions and 502 deletions

View File

@ -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();
});
});