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, expect } from 'vitest'
|
||||
import { pageSchema, type Page } from '@/lib/schema/page'
|
||||
import { exportPage } from '@/lib/exporter/html'
|
||||
|
||||
const makePage = (): Page =>
|
||||
pageSchema.parse({
|
||||
title: 'Benefits Test',
|
||||
locale: 'en',
|
||||
theme: { primaryColor: '#0ea5e9', fontFamily: 'Inter' },
|
||||
sections: [
|
||||
{ type: 'benefits', props: { items: ['Fast setup', 'No code', 'Accessible by default'] } },
|
||||
],
|
||||
form: { actionUrl: '', fields: [], spamProtection: { honeypotFieldName: '_hp', minSubmitSeconds: 2 } },
|
||||
seo: { title: 'SEO', description: 'Desc' },
|
||||
})
|
||||
|
||||
describe('Exporter - benefits section', () => {
|
||||
it('renders benefits as a section with h2 and aria-labelledby + list items', () => {
|
||||
const out = exportPage(makePage())
|
||||
const html = out.html
|
||||
expect(html).toContain('<section class="benefits" aria-labelledby="benefits-heading">')
|
||||
expect(html).toContain('<h2 id="benefits-heading">Benefits</h2>')
|
||||
expect(html).toContain('<ul class="benefits-list">')
|
||||
expect(html).toContain('<li class="benefit-item">Fast setup</li>')
|
||||
expect(html).toContain('<li class="benefit-item">No code</li>')
|
||||
expect(html).toContain('<li class="benefit-item">Accessible by default</li>')
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user