openvidu/openvidu-testapp/src/app/app.component.spec.ts

30 lines
1.0 KiB
TypeScript
Raw Normal View History

2024-07-02 19:19:05 +02:00
import { TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
2017-09-26 18:13:00 +02:00
import { AppComponent } from './app.component';
2024-07-02 19:19:05 +02:00
2017-09-26 18:13:00 +02:00
describe('AppComponent', () => {
2024-07-02 19:19:05 +02:00
beforeEach(() => TestBed.configureTestingModule({
imports: [RouterTestingModule],
declarations: [AppComponent]
2017-09-26 18:13:00 +02:00
}));
2024-07-02 19:19:05 +02:00
it('should create the app', () => {
2017-09-26 18:13:00 +02:00
const fixture = TestBed.createComponent(AppComponent);
2024-07-02 19:19:05 +02:00
const app = fixture.componentInstance;
2017-09-26 18:13:00 +02:00
expect(app).toBeTruthy();
2024-07-02 19:19:05 +02:00
});
it(`should have as title 'openvidu-testapp-livekit'`, () => {
2017-09-26 18:13:00 +02:00
const fixture = TestBed.createComponent(AppComponent);
2024-07-02 19:19:05 +02:00
const app = fixture.componentInstance;
expect(app.title).toEqual('openvidu-testapp-livekit');
});
it('should render title', () => {
2017-09-26 18:13:00 +02:00
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
2024-07-02 19:19:05 +02:00
const compiled = fixture.nativeElement as HTMLElement;
expect(compiled.querySelector('.content span')?.textContent).toContain('openvidu-testapp-livekit app is running!');
});
2017-09-26 18:13:00 +02:00
});