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:
@@ -175,4 +175,14 @@ describe('ContactDetails in the prerendered HTML', () => {
|
||||
);
|
||||
expect(html).not.toContain('data-testid="details"');
|
||||
});
|
||||
|
||||
it('loads the small portrait lazily, so a hidden one is never fetched', async () => {
|
||||
const html = await serverHtml(card({ portrait }));
|
||||
const doc = new DOMParser().parseFromString(html, 'text/html');
|
||||
expect(
|
||||
doc
|
||||
.querySelector('[data-testid="contact-details-portrait"]')
|
||||
?.getAttribute('loading'),
|
||||
).toBe('lazy');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -70,6 +70,7 @@ export default function ContactDetails({
|
||||
rounded="full"
|
||||
objectFit="cover"
|
||||
flexShrink={0}
|
||||
loading="lazy"
|
||||
data-testid="contact-details-portrait"
|
||||
/>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user