Files
open-design/packages/contracts/tests/brands-contract.test.ts
75af2b13cf fix(branding): preserve authored seed overrides (#5613)
* fix(branding): preserve authored seed overrides

* fix(contracts): expose brand seed overrides

---------

Co-authored-by: Rasmus Lovgren <booodhi@gmail.com>
2026-07-15 09:04:54 +00:00

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);
});
});