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:
@@ -262,4 +262,20 @@ describe('Testimonials in the prerendered HTML', () => {
|
||||
expect(html.match(/data-testid="testimonial-/g)).toHaveLength(1);
|
||||
expect(html).not.toContain('inert');
|
||||
});
|
||||
|
||||
it('marks the controls spacer and keeps the other copies hidden in the prerendered HTML', async () => {
|
||||
const html = await serverHtml(
|
||||
<Testimonials content={content} testimonials={testimonials} />,
|
||||
);
|
||||
const doc = new DOMParser().parseFromString(html, 'text/html');
|
||||
const marked = doc.querySelectorAll('[data-requires-js]');
|
||||
expect(marked).toHaveLength(1);
|
||||
expect(marked[0].textContent).toBe('');
|
||||
const copies = [...doc.querySelectorAll('[aria-hidden="true"]')].filter(
|
||||
(element) => element.querySelector('blockquote'),
|
||||
);
|
||||
expect(copies.length).toBeGreaterThan(0);
|
||||
for (const copy of copies)
|
||||
expect(copy.hasAttribute('inert')).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user