11 lines
968 B
TypeScript
11 lines
968 B
TypeScript
import { hasDetailBrandKnowledge } from '@/lib/detail-generator/brand-availability'
|
|
|
|
test('desktop availability needs a versioned source and all six visual rules, not just a brand name', () => {
|
|
const profile = { name: '本地规范样本', tone: '克制自然', primaryColor: '#333333', backgroundColor: '#ffffff', textColor: '#111111', fontFamily: 'Noto Sans SC' as const, status: 'draft' as const,
|
|
source: { label: 'Synthetic unit fixture', version: 'test-1', files: [{ name: 'brand.md', sha256: 'a'.repeat(64) }], adaptation: '' },
|
|
visualRules: { palette: '中性色', materials: '以已知资料为准', props: '少道具', lighting: '柔和', composition: '留白', quality: '产品一致' } }
|
|
expect(hasDetailBrandKnowledge(profile)).toBe(true)
|
|
expect(hasDetailBrandKnowledge({ ...profile, source: undefined })).toBe(false)
|
|
expect(hasDetailBrandKnowledge({ ...profile, visualRules: { ...profile.visualRules, composition: '' } })).toBe(false)
|
|
})
|