Adds the Lifestyle fotografie section to the homepage
Adds the first block below the hero: heading, intro and a staggered gallery of four live photos. Brings in the shared section building blocks (HomeSection, SectionHeading, Reveal) and DeferredImage, which holds back below-the-fold photos until the page has loaded so they do not compete with the hero for bandwidth. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
import { screen } from '@testing-library/react';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { axeResults } from '@/test/axe';
|
||||
import { renderWithProviders } from '@/test/renderWithProviders';
|
||||
import HomeSection from './HomeSection';
|
||||
|
||||
describe('HomeSection', () => {
|
||||
it('is a region named by its heading', async () => {
|
||||
const { container } = await renderWithProviders(
|
||||
<HomeSection labelledBy="about-title" data-testid="about">
|
||||
<h2 id="about-title">Over mij</h2>
|
||||
</HomeSection>,
|
||||
);
|
||||
expect(screen.getByRole('region', { name: 'Over mij' })).toBe(
|
||||
screen.getByTestId('about'),
|
||||
);
|
||||
expect(await axeResults(container)).toHaveNoViolations();
|
||||
});
|
||||
|
||||
it('passes the anchor id through for every tone, width and spacing', async () => {
|
||||
await renderWithProviders(
|
||||
<HomeSection
|
||||
labelledBy="contact-title"
|
||||
id="contact"
|
||||
tone="alt"
|
||||
width="narrow"
|
||||
spacing="tight"
|
||||
>
|
||||
<h2 id="contact-title">Contact</h2>
|
||||
</HomeSection>,
|
||||
);
|
||||
expect(screen.getByRole('region', { name: 'Contact' })).toHaveAttribute(
|
||||
'id',
|
||||
'contact',
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user