• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1import { TestBed } from '@angular/core/testing';
2import { AppComponent } from './app.component';
3
4describe('AppComponent', () => {
5  beforeEach(async () => {
6    await TestBed.configureTestingModule({
7      imports: [AppComponent],
8    }).compileComponents();
9  });
10
11  it('should create the app', () => {
12    const fixture = TestBed.createComponent(AppComponent);
13    const app = fixture.componentInstance;
14    expect(app).toBeTruthy();
15  });
16
17  it(`should have the 'motion_test_watcher_v2' title`, () => {
18    const fixture = TestBed.createComponent(AppComponent);
19    const app = fixture.componentInstance;
20    expect(app.title).toEqual('motion_test_watcher_v2');
21  });
22
23  it('should render title', () => {
24    const fixture = TestBed.createComponent(AppComponent);
25    fixture.detectChanges();
26    const compiled = fixture.nativeElement as HTMLElement;
27    expect(compiled.querySelector('h1')?.textContent).toContain(
28      'Hello, motion_test_watcher_v2'
29    );
30  });
31});
32