feat(forms): captcha is mandatory on every relay form; remove the toggle
relayFormWiring always emits captcha="1" for relay-wired forms (legacy captcha prop ignored, old projects with captcha:false load fine). CaptchaMock always shown for relay-wired forms; FormStylePanel toggle replaced by a read-only note. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0185ukXgKV8v9BUrQWXSUW4P
This commit is contained in:
1 parent
92da689e62
commit
bb97e5b396
10 files changed
+62
-59
No files matched your search
@@ -6,7 +6,7 @@ const toHtml = (FormContainer as any).toHtml;
|
||||
describe('FormContainer.toHtml relay wiring', () => {
|
||||
test('with recipientEmail: marker + placeholder action + honeypot, forces POST', () => {
|
||||
const { html } = toHtml({ recipientEmail: 'a@b.com', thankYouUrl: '/thx', method: 'GET' }, '<input name="email">');
|
||||
expect(html).toMatch(/<!--WHP-FORM id="F_[0-9a-z]+" recipient="a@b.com" thankyou="\/thx"-->/);
|
||||
expect(html).toMatch(/<!--WHP-FORM id="F_[0-9a-z]+" captcha="1" recipient="a@b.com" thankyou="\/thx"-->/);
|
||||
expect(html).toMatch(/action="__WHP_FORM_ACTION__F_[0-9a-z]+__"/);
|
||||
expect(html).toContain('method="POST"'); // relay forces POST even though method=GET
|
||||
expect(html).toContain('name="_gotcha"');
|
||||
|
||||
Reference in new issue
Block a user