From a9ced285d427020646bd31ffd7cd1e5e2ae83b84 Mon Sep 17 00:00:00 2001 From: Dagger Date: Fri, 13 Mar 2026 15:39:50 +0000 Subject: [PATCH] add_unit_tests_for_appcomponent_1773416355 --- src/app/app.spec.ts | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/app/app.spec.ts diff --git a/src/app/app.spec.ts b/src/app/app.spec.ts new file mode 100644 index 0000000..61dfcd4 --- /dev/null +++ b/src/app/app.spec.ts @@ -0,0 +1,31 @@ +import { TestBed } from '@angular/core/testing'; +import { RouterTestingModule } from '@angular/router/testing'; +import { App } from './app'; +import { beforeEach, describe, expect, it } from 'vitest'; + +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 the 'daggerverse-test-angular-project' title`, () => { + 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'); + }); +});