feat(site-builder): form blocks default to palette tokens

Refs #44

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
shadowdaoandClaude Sonnet 5.5 committed 2026-10-07 11:24:52 -07:00
1 parent d70f4933af
commit af43af7dc1
6 files changed
+53 -14

No files matched your search

@@ -286,3 +286,17 @@ describe('ContactForm.toHtml destination marker', () => {
expect(out.html).toContain('name="_gotcha"');
});
});
describe('ContactForm.toHtml palette token fallbacks (Refs #44)', () => {
test('submitColor empty -> primary token; input text -> text token', () => {
const { html } = toHtml({ recipientEmail: 'a@b.com', fields: [{ type: 'text', label: 'Name', name: 'name' }], submitColor: '' }, '');
expect(html).toContain('background-color:var(--wsb-primary)');
expect(html).toContain('color:var(--wsb-text)');
expect(html).not.toContain('#3b82f6');
expect(html).not.toContain('#1f2937');
});
test('explicit submitColor wins', () => {
const { html } = toHtml({ recipientEmail: 'a@b.com', fields: [], submitColor: '#ff0000' }, '');
expect(html).toContain('background-color:#ff0000');
});
});