You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
1003B

  1. import { TestBed } from '@angular/core/testing';
  2. import { RouterTestingModule } from '@angular/router/testing';
  3. import { AppComponent } from './app.component';
  4. describe('AppComponent', () => {
  5. beforeEach(() => TestBed.configureTestingModule({
  6. imports: [RouterTestingModule],
  7. declarations: [AppComponent]
  8. }));
  9. it('should create the app', () => {
  10. const fixture = TestBed.createComponent(AppComponent);
  11. const app = fixture.componentInstance;
  12. expect(app).toBeTruthy();
  13. });
  14. it(`should have as title 'iot-web-ui'`, () => {
  15. const fixture = TestBed.createComponent(AppComponent);
  16. const app = fixture.componentInstance;
  17. expect(app.title).toEqual('iot-web-ui');
  18. });
  19. it('should render title', () => {
  20. const fixture = TestBed.createComponent(AppComponent);
  21. fixture.detectChanges();
  22. const compiled = fixture.nativeElement as HTMLElement;
  23. expect(compiled.querySelector('.content span')?.textContent).toContain('iot-web-ui app is running!');
  24. });
  25. });