26 lines
980 B
TypeScript
26 lines
980 B
TypeScript
import { describe, expect, test } from 'vitest'
|
|
import { exportPage } from './html'
|
|
import { pageSchema, type Page } from '@/lib/schema/page'
|
|
|
|
function makePage(): Page {
|
|
return pageSchema.parse({
|
|
title: 'T',
|
|
locale: 'en',
|
|
theme: { primaryColor: '#000000', fontFamily: 'Inter' },
|
|
sections: [],
|
|
form: { actionUrl: '', fields: [], spamProtection: { honeypotFieldName: '_hp', minSubmitSeconds: 2 } },
|
|
analytics: { ga4MeasurementId: '', metaPixelId: '', customHeadHtml: '' },
|
|
seo: { title: 'SEO', description: 'Desc' },
|
|
})
|
|
}
|
|
|
|
describe('Exporter CSS tokens', () => {
|
|
test('includes focus outline, skip-link, and responsive MQ tokens', () => {
|
|
const out = exportPage(makePage())
|
|
expect(out.css).toMatch(/a\.skip-link:focus/)
|
|
expect(out.css).toMatch(/focus-visible|outline: 3px solid|outline-offset/)
|
|
expect(out.css).toMatch(/@media \(max-width: 640px\)/)
|
|
expect(out.css).toMatch(/@media \(prefers-reduced-motion: reduce\)/)
|
|
})
|
|
})
|