test(ci): add exporter heading levels and a11y typography smoke; update MAIN_PLAN
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import { describe, expect, test } from 'vitest'
|
||||
import { exportPage } from './html'
|
||||
import { pageSchema, type Page } from '@/lib/schema/page'
|
||||
|
||||
describe('Exporter - OG image meta', () => {
|
||||
test('includes og:image meta when seo.ogImage is provided', () => {
|
||||
const page: Page = pageSchema.parse({
|
||||
title: 'T',
|
||||
locale: 'en',
|
||||
theme: { primaryColor: '#000000', fontFamily: 'Inter' },
|
||||
sections: [],
|
||||
form: { actionUrl: '', fields: [], spamProtection: { honeypotFieldName: '_hp', minSubmitSeconds: 2 } },
|
||||
analytics: { ga4MeasurementId: '', metaPixelId: '', customHeadHtml: '' },
|
||||
seo: { title: 'SEO', description: 'Desc', ogImage: 'https://example.com/og.png' },
|
||||
})
|
||||
const out = exportPage(page)
|
||||
expect(out.html).toContain('<meta property="og:image" content="https://example.com/og.png" />')
|
||||
})
|
||||
|
||||
test('omits og:image meta when seo.ogImage is empty', () => {
|
||||
const page: Page = pageSchema.parse({
|
||||
title: 'T',
|
||||
locale: 'en',
|
||||
theme: { primaryColor: '#000000', fontFamily: 'Inter' },
|
||||
sections: [],
|
||||
form: { actionUrl: '', fields: [], spamProtection: { honeypotFieldName: '_hp', minSubmitSeconds: 2 } },
|
||||
analytics: { ga4MeasurementId: '', metaPixelId: '', customHeadHtml: '' },
|
||||
seo: { title: 'SEO', description: 'Desc' },
|
||||
})
|
||||
const out = exportPage(page)
|
||||
expect(out.html).not.toContain('og:image')
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user