diff --git a/src/app/app.spec.ts b/src/app/app.spec.ts new file mode 100644 index 0000000..a3fe1ae --- /dev/null +++ b/src/app/app.spec.ts @@ -0,0 +1,30 @@ +import { TestBed } from '@angular/core/testing'; +import { RouterTestingModule } from '@angular/router/testing'; +import { App } from './app'; + +describe('App', () => { + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [App, RouterTestingModule], + }).compileComponents(); + }); + + it('should create the app', () => { + const fixture = TestBed.createComponent(App); + const app = fixture.componentInstance; + expect(app).toBeTruthy(); + }); + + it(`should have as title 'daggerverse-test-angular-project'`, () => { + const fixture = TestBed.createComponent(App); + const app = fixture.componentInstance; + expect(app.title()).toEqual('daggerverse-test-angular-project'); + }); + + it('should render title', () => { + const fixture = TestBed.createComponent(App); + fixture.detectChanges(); + const compiled = fixture.nativeElement as HTMLElement; + expect(compiled.querySelector('h1')?.textContent).toContain('Hello, daggerverse-test-angular-project'); + }); +});