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: [ { type: 'features', props: { items: ['One', 'Two'] } }, { type: 'testimonials', props: { items: [{ author: 'Jane', quote: 'Great' }] } }, ] as Page['sections'], form: { actionUrl: '', fields: [], spamProtection: { honeypotFieldName: '_hp', minSubmitSeconds: 2 } }, analytics: { ga4MeasurementId: '', metaPixelId: '', customHeadHtml: '' }, seo: { title: 'SEO', description: 'Desc' }, }) } describe('Exporter - Features/Testimonials aria-labelledby', () => { test('has aria-labelledby and matching heading ids', () => { const out = exportPage(makePage()) expect(out.html).toContain('
') expect(out.html).toContain('

Features

') expect(out.html).toContain('
') expect(out.html).toContain('

Testimonials

') }) })