import { renderToStaticMarkup } from 'react-dom/server' import { describe, expect, it } from 'vitest' import { AnnounceNoteButton } from '@/features/publish-note-event/ui/AnnounceNoteButton' // The note list rendered this button unconditionally while a nearby card read // "Link NATS to enable this" (stage sweep, 2026-10-11): clicking it with NATS // unlinked submitted a form whose action is a no-op (`publishNoteCreated` returns // early without a connection). The button must agree with the module panel's own // `nats` slot about whether the module is linked, consistent with the enable-card // pattern used everywhere else in the template. describe('AnnounceNoteButton', () => { it('renders the live form when NATS is linked', () => { const markup = renderToStaticMarkup(AnnounceNoteButton({ id: 'note-1', linked: true })) expect(markup).toContain('