Files
dzanan.net/src/app/features/landing/landing-page.component.spec.ts
amar.dzanan 4d754f33c1
All checks were successful
Deploy dzanan.net / deploy (push) Successful in 1m0s
redesign complete
2026-09-06 22:16:19 +02:00

33 lines
1.2 KiB
TypeScript

import { TestBed } from '@angular/core/testing';
import { provideRouter } from '@angular/router';
import { LandingPageComponent } from './landing-page.component';
describe('LandingPageComponent', () => {
async function render(): Promise<HTMLElement> {
await TestBed.configureTestingModule({
imports: [LandingPageComponent],
providers: [provideRouter([])]
}).compileComponents();
const fixture = TestBed.createComponent(LandingPageComponent);
fixture.detectChanges();
return fixture.nativeElement as HTMLElement;
}
it('leads with the positioning and the profile terminal', async () => {
const page = await render();
expect(page.querySelector('h1')?.textContent).toContain('Complex systems, understood before changed.');
expect(page.querySelector('[data-testid="profile-terminal"]')?.textContent).toContain('"open_to"');
});
it('indexes every section page and offers direct contact', async () => {
const page = await render();
for (const href of ['/work', '/experience', '/cv', '/contact']) {
expect(page.querySelector(`[data-testid="index-row"][href="${href}"]`)).withContext(href).toBeTruthy();
}
expect(page.querySelector('a[href="mailto:amar@dzanan.net"]')).toBeTruthy();
});
});