Doppelkopf-Stats-Frontend/src/app/app.component.spec.ts

36 lines
1.0 KiB
TypeScript
Raw Normal View History

2022-09-02 12:39:24 +00:00
import {TestBed} from '@angular/core/testing';
import {RouterTestingModule} from '@angular/router/testing';
import {AppComponent} from './app.component';
2022-08-28 18:28:08 +00:00
describe('AppComponent', () => {
2022-09-02 12:39:24 +00:00
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [
RouterTestingModule
],
declarations: [
AppComponent
]
}).compileComponents();
});
2022-08-28 18:28:08 +00:00
2022-09-02 12:39:24 +00:00
it('should create the app', () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app).toBeTruthy();
});
2022-08-28 18:28:08 +00:00
2022-09-02 12:39:24 +00:00
it(`should have as title 'Doppelkopf-Stats-Frontend'`, () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app.title).toEqual('Doppelkopf-Stats-Frontend');
});
2022-08-28 18:28:08 +00:00
2022-09-02 12:39:24 +00:00
it('should render title', () => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.nativeElement as HTMLElement;
expect(compiled.querySelector('.content span')?.textContent).toContain('Doppelkopf-Stats-Frontend app is running!');
});
2022-08-28 18:28:08 +00:00
});