import { describe, it, expect } from 'vitest' import { exportPage } from '@/lib/exporter/html' import { pageSchema, type Page } from '@/lib/schema/page' function makePage(): Page { return pageSchema.parse({ title: 'Font Opt', locale: 'en', theme: { primaryColor: '#2563eb', fontFamily: 'Inter' }, sections: [ { type: 'hero', props: { heading: 'Hello', subheading: 'World', imageUrl: 'https://img/h.png' } } ], form: { actionUrl: '', fields: [], spamProtection: { honeypotFieldName: '_hp', minSubmitSeconds: 2 } }, seo: { title: 't', description: 'd' }, }) } describe('폰트 최적화', () => { it('head에 Google Fonts preconnect 링크가 포함된다', () => { const page = makePage() const out = exportPage(page) expect(out.html).toContain(' { const page = makePage() const out = exportPage(page) expect(out.css).toMatch(/font-family:[^;]*system-ui/i) }) })