Adds the fallbacks for visitors without JavaScript
The mobile menu works through CSS, and controls that need JavaScript are hidden without it. The contact photo gets its own preload, and the tests cover the new Reveal behaviour, the first row and the noscript markup. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -64,11 +64,20 @@ describe('PortfolioGallery', () => {
|
||||
screen.getByRole('button', { name: 'Alles', pressed: true }),
|
||||
).toBeInTheDocument();
|
||||
expect(tiles()).toHaveLength(10);
|
||||
// Every photo waits until the page has loaded (none eager)
|
||||
for (const image of screen.getAllByRole('img')) {
|
||||
expect(image).not.toHaveAttribute('fetchpriority');
|
||||
expect(image).toHaveAttribute('loading', 'lazy');
|
||||
}
|
||||
// The first row loads straight away, every later photo waits until
|
||||
// the page has loaded
|
||||
screen.getAllByRole('img').forEach((image, index) => {
|
||||
if (index === 0) {
|
||||
expect(image).toHaveAttribute('fetchpriority', 'high');
|
||||
expect(image).not.toHaveAttribute('loading');
|
||||
} else if (index < 3) {
|
||||
expect(image).toHaveAttribute('fetchpriority', 'high');
|
||||
expect(image).toHaveAttribute('loading', 'eager');
|
||||
} else {
|
||||
expect(image).not.toHaveAttribute('fetchpriority');
|
||||
expect(image).toHaveAttribute('loading', 'lazy');
|
||||
}
|
||||
});
|
||||
expect(await axeResults(container)).toHaveNoViolations();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user