ConusAI vendor v0.1.0-dev.20261013+85463d22

This commit is contained in:
ConusAI vendor v0.1.0-dev.20261013+85463d22
2026-10-13 20:45:57 +00:00
parent c3c6526952
commit 0da8a2a81b
67 changed files with 1510 additions and 10153 deletions
@@ -0,0 +1,25 @@
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('<form')
expect(markup).toContain('Announce')
expect(markup).not.toContain('disabled')
})
it('renders a disabled button with the enable-card explanation when NATS is not linked', () => {
const markup = renderToStaticMarkup(AnnounceNoteButton({ id: 'note-1', linked: false }))
expect(markup).not.toContain('<form')
expect(markup).toContain('disabled')
expect(markup).toContain('Link NATS to enable this.')
})
})