Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { App } from './app.ts'; // Assuming App is exported as App, not AppComponent

describe('App', () => {
let fixture: ComponentFixture<App>;
let component: App;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [App], // Standalone components are imported directly
}).compileComponents();

fixture = TestBed.createComponent(App);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create the app', () => {
expect(component).toBeTruthy();
});

it('should have the title 'daggerverse-test-angular-project'', () => {
expect(component.title()).toEqual('daggerverse-test-angular-project');
});

it('should render title in an h1 tag', () => {
const compiled = fixture.nativeElement as HTMLElement;
expect(compiled.querySelector('h1')?.textContent).toContain('Hello, daggerverse-test-angular-project');
});
});