19 lines
946 B
TypeScript
19 lines
946 B
TypeScript
import { renderToStaticMarkup } from 'react-dom/server'
|
|
import { describe, expect, it } from 'vitest'
|
|
import { ExportNotesButton } from '@/features/export-notes/ui/ExportNotesButton'
|
|
|
|
// The button gave no feedback at all after submit: no message, no object key, and
|
|
// nothing in the audit timeline (stage sweep, 2026-10-11; the audit half is covered by
|
|
// exportNotes's own tests). This only checks the button's initial render — before any
|
|
// submission `useActionState`'s state is `null` — so neither the success nor the error
|
|
// branch has leaked into the markup by mistake.
|
|
describe('ExportNotesButton', () => {
|
|
it('renders the form with no result before any submission', () => {
|
|
const markup = renderToStaticMarkup(<ExportNotesButton />)
|
|
expect(markup).toContain('<form')
|
|
expect(markup).toContain('Export my notes to S3')
|
|
expect(markup).not.toContain('Exported')
|
|
expect(markup).not.toMatch(/role="alert"/)
|
|
})
|
|
})
|