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: 'Sections Regression CTA/Testimonials', locale: 'en', theme: { primaryColor: '#0ea5e9', fontFamily: 'Inter' }, sections: [ { type: 'testimonials', props: { items: [{ author: 'Linus', quote: 'Simple and fast' }] } }, { type: 'cta', props: { text: 'Get Started', href: '/start' } }, ], form: { actionUrl: '', fields: [], spamProtection: { honeypotFieldName: '_hp', minSubmitSeconds: 2 } }, seo: { title: 'SEO', description: 'Desc' }, }) } describe('Exporter - CTA and Testimonials regression', () => { it('renders testimonials figure/blockquote/figcaption structure', () => { const out = exportPage(makePage()) const html = out.html expect(html).toMatch(/
/) expect(html).toMatch(/

Testimonials<\/h2>/) expect(html).toMatch(/
[\s\S]*
“Simple and fast”<\/blockquote>[\s\S]*
— Linus<\/figcaption>[\s\S]*<\/figure>/) }) it('renders CTA link with correct class and href', () => { const out = exportPage(makePage()) const html = out.html expect(html).toMatch(/
/) expect(html).toMatch(/

CTA<\/h2>/) expect(html).toMatch(/Get Started<\/a>/) }) })