import { describe, it, expect } from 'vitest' import { exportFrame } from '@/lib/wysiwyg/export' import type { Frame } from '@/lib/wysiwyg/schema' function baseFrame(): Frame { return { id: 'f', width: 400, height: 300, background: '#ffffff', layers: [{ id: 'l1', name: 'Base', visible: true, locked: false, objects: [] }], } } describe('wysiwyg export - forms aria-describedby(help)', () => { it('input: adds help element and aria-describedby linkage', () => { const f = baseFrame() f.layers[0].objects.push({ id: 'in1', type: 'input', x: 10, y: 20, width: 260, height: 48, rotate: 0, zIndex: 0, props: { name: 'email', label: 'Email', placeholder: '', required: false, help: 'We will not spam you.' } }) const out = exportFrame(f) expect(out.html).toMatch(/
[\s\S]*[\s\S]* { const f = baseFrame() f.layers[0].objects.push({ id: 'sel1', type: 'select', x: 0, y: 0, width: 100, height: 30, rotate: 0, zIndex: 0, props: { name: 'size', label: 'Size', options: ['S'], defaultValue: 'S', help: 'Choose wisely.' } }) const out = exportFrame(f) expect(out.html).toMatch(/