feat(site-builder): tokenise remaining component design colours (Navbar, Menu, Footer, SocialLinks, StickyCallBar, BackgroundSection, ContentSlider, Countdown, HeroSimple)
Refs #44 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2877bc06fa
commit
e347a4334d
19 files changed
+190
-68
No files matched your search
@@ -65,3 +65,24 @@ describe('HeroSimple.toHtml bgPosition focal point (#55)', () => {
|
||||
expect(html).not.toContain('<script>alert(1)');
|
||||
});
|
||||
});
|
||||
|
||||
describe('HeroSimple.toHtml design tokens (#44)', () => {
|
||||
test('default craft props export var(--wsb-*) and none of the old design hex', () => {
|
||||
const props = { ...((HeroSimple as any).craft.props as object) };
|
||||
const { html } = (((HeroSimple) as any).toHtml)(props, '', 'node-tok');
|
||||
const lower = html.toLowerCase();
|
||||
for (const t of ['text', 'bg']) expect(html, `token ${t}`).toContain(`var(--wsb-${t})`);
|
||||
for (const hex of ['#1e293b', '#667eea', '#764ba2']) expect(lower, `old ${hex}`).not.toContain(hex.toLowerCase());
|
||||
});
|
||||
});
|
||||
|
||||
describe('HeroSimple.toHtml gradient defaults are tokens (#44)', () => {
|
||||
test('bgType gradient with the default stops uses primary -> secondary, not #667eea/#764ba2', () => {
|
||||
const props = { ...((HeroSimple as any).craft.props as object), bgType: 'gradient' };
|
||||
const { html } = toHtml(props, '', 'node-g');
|
||||
expect(html).toContain('var(--wsb-primary)');
|
||||
expect(html).toContain('var(--wsb-secondary)');
|
||||
expect(html.toLowerCase()).not.toContain('#667eea');
|
||||
expect(html.toLowerCase()).not.toContain('#764ba2');
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user