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:
@@ -1,7 +1,7 @@
|
||||
import fc from 'fast-check';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { anyEmail, validEmail } from '../test/arbitraries';
|
||||
import { emailAddress } from './emailAddress';
|
||||
import { emailAddress, isEmailAddressValid } from './emailAddress';
|
||||
|
||||
describe('emailAddress', () => {
|
||||
it('voegt geldige delen samen', () => {
|
||||
@@ -46,3 +46,33 @@ describe('emailAddress', () => {
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('isEmailAddressValid', () => {
|
||||
it('is waar voor geldige delen', () => {
|
||||
expect(
|
||||
isEmailAddressValid({ user: 'info', domain: 'andreaslop.nl' }),
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it('is onwaar bij ongeldige delen', () => {
|
||||
for (const parts of [
|
||||
{ user: '', domain: 'andreaslop.nl' },
|
||||
{ user: 'info', domain: '' },
|
||||
{ user: 'in fo', domain: 'andreaslop.nl' },
|
||||
{ user: 'info', domain: 'andreaslop' },
|
||||
{ user: 'info', domain: 'andrea@slop.nl' },
|
||||
]) {
|
||||
expect(isEmailAddressValid(parts)).toBe(false);
|
||||
}
|
||||
});
|
||||
|
||||
it('is precies dan waar als emailAddress een adres geeft (oracle)', () => {
|
||||
fc.assert(
|
||||
fc.property(anyEmail, (parts) => {
|
||||
expect(isEmailAddressValid(parts)).toBe(
|
||||
emailAddress(parts) !== null,
|
||||
);
|
||||
}),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user