test: expand exporter/css/a11y/i18n regressions and add e2e skip-link focus check
CI / test (pull_request) Successful in 52s
CI / test (pull_request) Successful in 52s
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { describe, it } from 'vitest'
|
||||
import { pageSchema, type Page } from '@/lib/schema/page'
|
||||
import { exportPage } from '@/lib/exporter/html'
|
||||
import { assertSectionA11y } from '@/lib/exporter/testUtils/sectionA11y'
|
||||
|
||||
function makeFullPage(): Page {
|
||||
return pageSchema.parse({
|
||||
title: 'A11y Template',
|
||||
locale: 'en',
|
||||
theme: { primaryColor: '#0ea5e9', fontFamily: 'Inter' },
|
||||
sections: [
|
||||
{ type: 'hero', props: { heading: 'Welcome', subheading: '', imageUrl: 'https://via.placeholder.com/800x400' } },
|
||||
{ type: 'features', props: { items: ['A','B','C'] } },
|
||||
{ type: 'testimonials', props: { items: [{ author: 'Jane', quote: 'Great!' }] } },
|
||||
{ type: 'faq', props: { items: [{ q: 'Q1', a: 'A1' }] } },
|
||||
{ type: 'cta', props: { text: 'Get Started', href: '#' } },
|
||||
],
|
||||
form: { actionUrl: '', fields: [], spamProtection: { honeypotFieldName: '_hp', minSubmitSeconds: 2 } },
|
||||
seo: { title: 'SEO', description: 'Desc' },
|
||||
})
|
||||
}
|
||||
|
||||
describe('Exporter - section a11y template', () => {
|
||||
it('validates basic a11y landmarks, headings and tokens', () => {
|
||||
const out = exportPage(makeFullPage())
|
||||
assertSectionA11y(out.html)
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user