upgrade to tamagui v2 and guest pwa overhaul
This commit is contained in:
31
resources/js/guest-v2/__tests__/eventBranding.test.ts
Normal file
31
resources/js/guest-v2/__tests__/eventBranding.test.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
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',
|
||||
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');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user