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(
Over mij
,
);
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(
,
);
expect(screen.getByRole('region', { name: 'Contact' })).toHaveAttribute(
'id',
'contact',
);
});
it('leaves out the content column at full width', async () => {
await renderWithProviders(
Instagram
,
);
// The heading is a direct child of the section, not of a Container
expect(screen.getByTestId('child').parentElement).toBe(
screen.getByRole('region', { name: 'Instagram' }),
);
});
});