34 lines
1.1 KiB
TypeScript
34 lines
1.1 KiB
TypeScript
import { describe, expect, it } from 'vitest';
|
|
import { mapEventBranding } from '../lib/eventBranding';
|
|
|
|
describe('mapEventBranding', () => {
|
|
it('maps palette, typography, and buttons from payload', () => {
|
|
const result = mapEventBranding({
|
|
primary_color: '#112233',
|
|
secondary_color: '#445566',
|
|
background_color: '#000000',
|
|
font_family: 'Event Body',
|
|
heading_font: 'Event Heading',
|
|
button_radius: 16,
|
|
button_primary_color: '#abcdef',
|
|
welcome_message: 'Willkommen beim Event!',
|
|
palette: {
|
|
surface: '#111111',
|
|
},
|
|
typography: {
|
|
size: 'l',
|
|
},
|
|
});
|
|
|
|
expect(result?.primaryColor).toBe('#112233');
|
|
expect(result?.secondaryColor).toBe('#445566');
|
|
expect(result?.palette?.surface).toBe('#111111');
|
|
expect(result?.typography?.heading).toBe('Event Heading');
|
|
expect(result?.typography?.body).toBe('Event Body');
|
|
expect(result?.typography?.sizePreset).toBe('l');
|
|
expect(result?.buttons?.radius).toBe(16);
|
|
expect(result?.buttons?.primary).toBe('#abcdef');
|
|
expect(result?.welcomeMessage).toBe('Willkommen beim Event!');
|
|
});
|
|
});
|