Connects the contact form to the CMS API through the cms-client package
Copies the headless cms-client package (SlpSoftware 93fa729) and builds the form on useContactForm: availability check when the form is in view (no request while switched off), the readable shoot label as subject, the Friendly Captcha widget as its own lazy chunk, trackEvent for contact-sent and contact-failed. Removes the old reducer, validation and submit stub. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -191,7 +191,7 @@ describe('app', () => {
|
||||
await screen.findByTestId('contact-form-shoot', undefined, {
|
||||
timeout: 10_000,
|
||||
}),
|
||||
).toHaveValue('newborn');
|
||||
).toHaveValue('Newborn');
|
||||
await waitFor(() => expect(router.state.location.searchStr).toBe(''));
|
||||
expect(router.state.location.pathname).toBe('/contact');
|
||||
expect(document.activeElement).toBe(document.body);
|
||||
@@ -451,7 +451,7 @@ describe('homepage ?pakket=', () => {
|
||||
await screen.findByTestId('contact-form-shoot', undefined, {
|
||||
timeout: 10_000,
|
||||
}),
|
||||
).toHaveValue('newborn');
|
||||
).toHaveValue('Newborn');
|
||||
await waitFor(() =>
|
||||
expect(
|
||||
scrolls.mock.contexts.some(
|
||||
@@ -468,11 +468,11 @@ describe('homepage ?pakket=', () => {
|
||||
await screen.findByTestId('contact-form-shoot', undefined, {
|
||||
timeout: 10_000,
|
||||
}),
|
||||
).toHaveValue('newborn');
|
||||
).toHaveValue('Newborn');
|
||||
await waitFor(() => expect(router.state.location.searchStr).toBe(''));
|
||||
expect(router.state.location.hash).toBe('contact');
|
||||
// The form stays once loaded, also now that ?pakket= is gone
|
||||
expect(screen.getByTestId('contact-form-shoot')).toHaveValue('newborn');
|
||||
expect(screen.getByTestId('contact-form-shoot')).toHaveValue('Newborn');
|
||||
// within the section: the footer has a "Contact" heading too
|
||||
expect(
|
||||
within(screen.getByRole('region', { name: 'Contact' })).getByRole(
|
||||
|
||||
Reference in New Issue
Block a user