mirror of
https://github.com/nexu-io/open-design.git
synced 2026-10-27 09:51:12 +01:00
* fix(branding): preserve authored seed overrides * fix(contracts): expose brand seed overrides --------- Co-authored-by: Rasmus Lovgren <booodhi@gmail.com>
40 lines
1.3 KiB
TypeScript
40 lines
1.3 KiB
TypeScript
import { describe, expect, it } from 'vitest';
|
|
|
|
import type { BrandFinalizeResponse } from '../src/api/brands';
|
|
|
|
describe('brands contract', () => {
|
|
it('exposes authored seed overrides on finalized brands', () => {
|
|
const response = {
|
|
id: 'brand-acme',
|
|
brand: {
|
|
name: 'Acme',
|
|
tagline: 'Reliable examples',
|
|
description: 'A contract fixture.',
|
|
sourceUrl: 'https://example.com',
|
|
logo: { primary: null, alternates: [], notes: '' },
|
|
colors: [],
|
|
typography: {
|
|
display: { family: 'Inter', fallbacks: ['sans-serif'], weights: [400, 700] },
|
|
body: { family: 'Inter', fallbacks: ['sans-serif'], weights: [400, 700] },
|
|
},
|
|
voice: {
|
|
adjectives: [],
|
|
tone: '',
|
|
messagingPillars: [],
|
|
vocabulary: { use: [], avoid: [] },
|
|
},
|
|
imagery: { style: '', subjects: [], treatment: '', avoid: [] },
|
|
layout: { radius: '', borderWeight: '', spacing: '', postureRules: [] },
|
|
seed: { controlHeight: 44 },
|
|
},
|
|
designSystemId: 'user:brand-acme',
|
|
projectId: 'brand-brand-acme',
|
|
files: ['system/seed.json'],
|
|
} satisfies BrandFinalizeResponse;
|
|
|
|
const restored = JSON.parse(JSON.stringify(response)) as BrandFinalizeResponse;
|
|
|
|
expect(restored.brand.seed?.controlHeight).toBe(44);
|
|
});
|
|
});
|