fork of hey-api/openapi-ts because I need some additional things
at main 1.0 kB view raw
1import { provideHttpClient } from '@angular/common/http'; 2import { TestBed } from '@angular/core/testing'; 3 4import { AppComponent } from './app.component'; 5 6describe('AppComponent', () => { 7 beforeEach(async () => { 8 await TestBed.configureTestingModule({ 9 imports: [AppComponent], 10 providers: [provideHttpClient()], 11 }).compileComponents(); 12 }); 13 14 it('should create the app', () => { 15 const fixture = TestBed.createComponent(AppComponent); 16 const app = fixture.componentInstance; 17 expect(app).toBeTruthy(); 18 }); 19 20 it(`should have the 'angular' title`, () => { 21 const fixture = TestBed.createComponent(AppComponent); 22 const app = fixture.componentInstance; 23 expect(app.title).toEqual('angular'); 24 }); 25 26 it('should render title', () => { 27 const fixture = TestBed.createComponent(AppComponent); 28 fixture.detectChanges(); 29 const compiled = fixture.nativeElement as HTMLElement; 30 expect(compiled.querySelector('h1')?.textContent).toContain( 31 '@hey-api/openapi-ts 🤝 Angular', 32 ); 33 }); 34});