org
1import { TestBed } from '@angular/core/testing';
2import { AppComponent } from './app.component';
3import { NxWelcomeComponent } from './nx-welcome.component';
4import { RouterTestingModule } from '@angular/router/testing';
5
6describe('AppComponent', () => {
7beforeEach(async () => {
8await TestBed.configureTestingModule({
9imports: [AppComponent, NxWelcomeComponent, RouterTestingModule],
10}).compileComponents();
11});
12
13it('should render title', () => {
14const fixture = TestBed.createComponent(AppComponent);
15fixture.detectChanges();
16const compiled = fixture.nativeElement as HTMLElement;
17expect(compiled.querySelector('h1')?.textContent).toContain('Welcome org');
18});
19
20it(`should have as title 'org'`, () => {
21const fixture = TestBed.createComponent(AppComponent);
22const app = fixture.componentInstance;
23expect(app.title).toEqual('org');
24});
25});
26