Makes the first render match the prerendered HTML
Search values, the 404 buttons and the footer year now apply after hydration. The e-mail address stays out of the HTML behind a placeholder, and all review texts are in the page, so crawlers can read them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,7 @@ import packages from '@/content/packages';
|
||||
import siteContent from '@/content/siteContent';
|
||||
import { shootOptions } from '@/lib/shootOptions';
|
||||
import { axeResults } from '@/test/axe';
|
||||
import { serverHtml } from '@/test/hydrate';
|
||||
import { renderWithProviders } from '@/test/renderWithProviders';
|
||||
import ContactForm from './ContactForm';
|
||||
|
||||
@@ -234,3 +235,21 @@ describe('ContactForm', () => {
|
||||
expect(container.querySelector('[data-robot-check]')).not.toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
describe('ContactForm in the prerendered HTML', () => {
|
||||
it('does not hold the address (BR-MAIL-06)', async () => {
|
||||
const html = await serverHtml(
|
||||
<ContactForm
|
||||
idPrefix="test"
|
||||
options={options}
|
||||
mailSubject="Vraag via andreaslop.nl"
|
||||
email={siteContent.email}
|
||||
replyTime="1-2 werkdagen"
|
||||
submit={vi.fn()}
|
||||
/>,
|
||||
);
|
||||
expect(html).toContain('contact-form-submit');
|
||||
expect(html.toLowerCase()).not.toContain('info@andreaslop.nl');
|
||||
expect(html).not.toContain('mailto:');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user