Files

35 lines
1.1 KiB
TypeScript

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: 'Sections',
locale: 'en',
theme: { primaryColor: '#0ea5e9', fontFamily: 'Inter' },
sections: [
{ type: 'faq', props: { items: [ { q: 'Q1?', a: 'A1.' }, { q: 'Q2?', a: 'A2.' } ] } },
{ type: 'cta', props: { text: 'Get Started', href: '#start' } },
],
form: { actionUrl: '', fields: [], spamProtection: { honeypotFieldName: '_hp', minSubmitSeconds: 2 } },
seo: { title: 'Sections', description: 'desc' },
})
describe('Exporter - FAQ/CTA sections', () => {
it('FAQ와 CTA 섹션을 렌더링한다', () => {
const page = makePage()
const out = exportPage(page)
// FAQ
expect(out.html).toContain('Q1?')
expect(out.html).toContain('A1.')
expect(out.html).toContain('Q2?')
expect(out.html).toContain('A2.')
// CTA
expect(out.html).toContain('Get Started')
expect(out.html).toContain('#start')
})
})