test: add tests for WikilinkChatInput and buildContextSnapshot
- WikilinkChatInput: 18 tests covering menu trigger, filtering, pill creation,
dedup, removal, keyboard nav, Enter select, send with refs, disabled state
- buildContextSnapshot: 10 tests for structured context JSON output
including activeNote, openTabs, vault summary, references, frontmatter
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 12:19:23 +01:00
|
|
|
import { useState } from 'react'
|
|
|
|
|
import { describe, it, expect, vi } from 'vitest'
|
2026-04-12 13:14:18 +02:00
|
|
|
import { render, screen, fireEvent } from '@testing-library/react'
|
test: add tests for WikilinkChatInput and buildContextSnapshot
- WikilinkChatInput: 18 tests covering menu trigger, filtering, pill creation,
dedup, removal, keyboard nav, Enter select, send with refs, disabled state
- buildContextSnapshot: 10 tests for structured context JSON output
including activeNote, openTabs, vault summary, references, frontmatter
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 12:19:23 +01:00
|
|
|
import { WikilinkChatInput } from './WikilinkChatInput'
|
|
|
|
|
import type { VaultEntry } from '../types'
|
|
|
|
|
|
|
|
|
|
const makeEntry = (overrides: Partial<VaultEntry> = {}): VaultEntry => ({
|
|
|
|
|
path: '/vault/note/test.md',
|
|
|
|
|
filename: 'test.md',
|
|
|
|
|
title: 'Test Note',
|
|
|
|
|
isA: 'Note',
|
|
|
|
|
aliases: [],
|
|
|
|
|
belongsTo: [],
|
|
|
|
|
relatedTo: [],
|
|
|
|
|
status: null,
|
|
|
|
|
owner: null,
|
|
|
|
|
cadence: null,
|
|
|
|
|
archived: false,
|
|
|
|
|
modifiedAt: 1700000000,
|
|
|
|
|
createdAt: 1700000000,
|
|
|
|
|
fileSize: 100,
|
|
|
|
|
snippet: '',
|
|
|
|
|
wordCount: 0,
|
|
|
|
|
relationships: {},
|
|
|
|
|
icon: null,
|
|
|
|
|
color: null,
|
|
|
|
|
order: null,
|
|
|
|
|
outgoingLinks: [],
|
|
|
|
|
...overrides,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const entries: VaultEntry[] = [
|
|
|
|
|
makeEntry({ path: '/vault/alpha.md', title: 'Alpha', filename: 'alpha.md', isA: 'Project' }),
|
2026-04-12 13:14:18 +02:00
|
|
|
makeEntry({ path: '/vault/beta.md', title: 'Beta', filename: 'beta.md', isA: 'Person', aliases: ['BLT'] }),
|
test: add tests for WikilinkChatInput and buildContextSnapshot
- WikilinkChatInput: 18 tests covering menu trigger, filtering, pill creation,
dedup, removal, keyboard nav, Enter select, send with refs, disabled state
- buildContextSnapshot: 10 tests for structured context JSON output
including activeNote, openTabs, vault summary, references, frontmatter
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 12:19:23 +01:00
|
|
|
makeEntry({ path: '/vault/gamma.md', title: 'Gamma', filename: 'gamma.md' }),
|
|
|
|
|
]
|
|
|
|
|
|
2026-04-12 13:14:18 +02:00
|
|
|
function Controlled({
|
|
|
|
|
onSend,
|
|
|
|
|
disabled = false,
|
|
|
|
|
placeholder,
|
|
|
|
|
}: {
|
test: add tests for WikilinkChatInput and buildContextSnapshot
- WikilinkChatInput: 18 tests covering menu trigger, filtering, pill creation,
dedup, removal, keyboard nav, Enter select, send with refs, disabled state
- buildContextSnapshot: 10 tests for structured context JSON output
including activeNote, openTabs, vault summary, references, frontmatter
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 12:19:23 +01:00
|
|
|
onSend?: (text: string, refs: Array<{ title: string; path: string; type: string | null }>) => void
|
|
|
|
|
disabled?: boolean
|
|
|
|
|
placeholder?: string
|
|
|
|
|
}) {
|
|
|
|
|
const [value, setValue] = useState('')
|
2026-04-12 13:14:18 +02:00
|
|
|
|
test: add tests for WikilinkChatInput and buildContextSnapshot
- WikilinkChatInput: 18 tests covering menu trigger, filtering, pill creation,
dedup, removal, keyboard nav, Enter select, send with refs, disabled state
- buildContextSnapshot: 10 tests for structured context JSON output
including activeNote, openTabs, vault summary, references, frontmatter
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 12:19:23 +01:00
|
|
|
return (
|
|
|
|
|
<WikilinkChatInput
|
2026-04-12 13:14:18 +02:00
|
|
|
entries={entries}
|
test: add tests for WikilinkChatInput and buildContextSnapshot
- WikilinkChatInput: 18 tests covering menu trigger, filtering, pill creation,
dedup, removal, keyboard nav, Enter select, send with refs, disabled state
- buildContextSnapshot: 10 tests for structured context JSON output
including activeNote, openTabs, vault summary, references, frontmatter
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 12:19:23 +01:00
|
|
|
value={value}
|
|
|
|
|
onChange={setValue}
|
|
|
|
|
onSend={onSend ?? vi.fn()}
|
2026-04-12 13:14:18 +02:00
|
|
|
disabled={disabled}
|
|
|
|
|
placeholder={placeholder}
|
test: add tests for WikilinkChatInput and buildContextSnapshot
- WikilinkChatInput: 18 tests covering menu trigger, filtering, pill creation,
dedup, removal, keyboard nav, Enter select, send with refs, disabled state
- buildContextSnapshot: 10 tests for structured context JSON output
including activeNote, openTabs, vault summary, references, frontmatter
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 12:19:23 +01:00
|
|
|
/>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-12 13:14:18 +02:00
|
|
|
function setSelection(editor: HTMLElement, offset: number) {
|
|
|
|
|
const selection = window.getSelection()
|
|
|
|
|
if (!selection) return
|
|
|
|
|
|
|
|
|
|
const targetNode = editor.firstChild ?? editor
|
|
|
|
|
const safeOffset = targetNode.nodeType === Node.TEXT_NODE
|
|
|
|
|
? Math.min(offset, targetNode.textContent?.length ?? 0)
|
|
|
|
|
: Math.min(offset, targetNode.childNodes.length)
|
|
|
|
|
|
|
|
|
|
const range = document.createRange()
|
|
|
|
|
range.setStart(targetNode, safeOffset)
|
|
|
|
|
range.collapse(true)
|
|
|
|
|
selection.removeAllRanges()
|
|
|
|
|
selection.addRange(range)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function updateEditorText(text: string) {
|
|
|
|
|
const editor = screen.getByTestId('agent-input')
|
|
|
|
|
fireEvent.focus(editor)
|
|
|
|
|
editor.textContent = text
|
|
|
|
|
setSelection(editor, text.length)
|
|
|
|
|
fireEvent.input(editor)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function clickFirstSuggestion() {
|
|
|
|
|
const rows = screen.getByTestId('wikilink-menu').querySelectorAll('[class*="cursor-pointer"]')
|
|
|
|
|
expect(rows.length).toBeGreaterThan(0)
|
|
|
|
|
fireEvent.click(rows[0])
|
test: add tests for WikilinkChatInput and buildContextSnapshot
- WikilinkChatInput: 18 tests covering menu trigger, filtering, pill creation,
dedup, removal, keyboard nav, Enter select, send with refs, disabled state
- buildContextSnapshot: 10 tests for structured context JSON output
including activeNote, openTabs, vault summary, references, frontmatter
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 12:19:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
describe('WikilinkChatInput', () => {
|
2026-04-12 13:14:18 +02:00
|
|
|
it('renders the placeholder overlay for an empty draft', () => {
|
|
|
|
|
render(<Controlled placeholder="Ask something..." />)
|
|
|
|
|
expect(screen.getByText('Ask something...')).toBeInTheDocument()
|
|
|
|
|
expect(screen.getByTestId('agent-input')).toHaveAttribute('aria-placeholder', 'Ask something...')
|
test: add tests for WikilinkChatInput and buildContextSnapshot
- WikilinkChatInput: 18 tests covering menu trigger, filtering, pill creation,
dedup, removal, keyboard nav, Enter select, send with refs, disabled state
- buildContextSnapshot: 10 tests for structured context JSON output
including activeNote, openTabs, vault summary, references, frontmatter
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 12:19:23 +01:00
|
|
|
})
|
|
|
|
|
|
2026-04-12 13:14:18 +02:00
|
|
|
it('calls onChange when the draft changes', () => {
|
test: add tests for WikilinkChatInput and buildContextSnapshot
- WikilinkChatInput: 18 tests covering menu trigger, filtering, pill creation,
dedup, removal, keyboard nav, Enter select, send with refs, disabled state
- buildContextSnapshot: 10 tests for structured context JSON output
including activeNote, openTabs, vault summary, references, frontmatter
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 12:19:23 +01:00
|
|
|
const onChange = vi.fn()
|
|
|
|
|
render(
|
|
|
|
|
<WikilinkChatInput entries={entries} value="" onChange={onChange} onSend={vi.fn()} />,
|
|
|
|
|
)
|
2026-04-12 13:14:18 +02:00
|
|
|
|
|
|
|
|
updateEditorText('hello')
|
test: add tests for WikilinkChatInput and buildContextSnapshot
- WikilinkChatInput: 18 tests covering menu trigger, filtering, pill creation,
dedup, removal, keyboard nav, Enter select, send with refs, disabled state
- buildContextSnapshot: 10 tests for structured context JSON output
including activeNote, openTabs, vault summary, references, frontmatter
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 12:19:23 +01:00
|
|
|
expect(onChange).toHaveBeenCalledWith('hello')
|
|
|
|
|
})
|
|
|
|
|
|
2026-04-12 13:14:18 +02:00
|
|
|
it('shows wikilink suggestions after typing [[', () => {
|
|
|
|
|
render(<Controlled />)
|
|
|
|
|
updateEditorText('[[a')
|
test: add tests for WikilinkChatInput and buildContextSnapshot
- WikilinkChatInput: 18 tests covering menu trigger, filtering, pill creation,
dedup, removal, keyboard nav, Enter select, send with refs, disabled state
- buildContextSnapshot: 10 tests for structured context JSON output
including activeNote, openTabs, vault summary, references, frontmatter
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 12:19:23 +01:00
|
|
|
|
|
|
|
|
const menu = screen.getByTestId('wikilink-menu')
|
|
|
|
|
expect(menu.textContent).toContain('Alpha')
|
|
|
|
|
})
|
|
|
|
|
|
2026-04-12 13:14:18 +02:00
|
|
|
it('matches suggestions by alias', () => {
|
|
|
|
|
render(<Controlled />)
|
|
|
|
|
updateEditorText('[[BLT')
|
test: add tests for WikilinkChatInput and buildContextSnapshot
- WikilinkChatInput: 18 tests covering menu trigger, filtering, pill creation,
dedup, removal, keyboard nav, Enter select, send with refs, disabled state
- buildContextSnapshot: 10 tests for structured context JSON output
including activeNote, openTabs, vault summary, references, frontmatter
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 12:19:23 +01:00
|
|
|
|
2026-04-12 13:14:18 +02:00
|
|
|
expect(screen.getByTestId('wikilink-menu').textContent).toContain('Beta')
|
test: add tests for WikilinkChatInput and buildContextSnapshot
- WikilinkChatInput: 18 tests covering menu trigger, filtering, pill creation,
dedup, removal, keyboard nav, Enter select, send with refs, disabled state
- buildContextSnapshot: 10 tests for structured context JSON output
including activeNote, openTabs, vault summary, references, frontmatter
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 12:19:23 +01:00
|
|
|
})
|
|
|
|
|
|
2026-04-12 13:14:18 +02:00
|
|
|
it('renders selected wikilinks inline instead of in a separate pill strip', () => {
|
|
|
|
|
render(<Controlled />)
|
|
|
|
|
updateEditorText('edit my [[alp')
|
|
|
|
|
clickFirstSuggestion()
|
test: add tests for WikilinkChatInput and buildContextSnapshot
- WikilinkChatInput: 18 tests covering menu trigger, filtering, pill creation,
dedup, removal, keyboard nav, Enter select, send with refs, disabled state
- buildContextSnapshot: 10 tests for structured context JSON output
including activeNote, openTabs, vault summary, references, frontmatter
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 12:19:23 +01:00
|
|
|
|
2026-04-12 13:14:18 +02:00
|
|
|
expect(screen.queryByTestId('reference-pill')).toBeNull()
|
|
|
|
|
expect(screen.getByTestId('inline-wikilink-chip')).toBeInTheDocument()
|
|
|
|
|
expect(screen.getByTestId('agent-input').textContent).toContain('Alpha')
|
test: add tests for WikilinkChatInput and buildContextSnapshot
- WikilinkChatInput: 18 tests covering menu trigger, filtering, pill creation,
dedup, removal, keyboard nav, Enter select, send with refs, disabled state
- buildContextSnapshot: 10 tests for structured context JSON output
including activeNote, openTabs, vault summary, references, frontmatter
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 12:19:23 +01:00
|
|
|
})
|
|
|
|
|
|
2026-04-12 13:14:18 +02:00
|
|
|
it('selects a suggestion with Enter before sending the draft', () => {
|
|
|
|
|
const onSend = vi.fn()
|
|
|
|
|
render(<Controlled onSend={onSend} />)
|
|
|
|
|
updateEditorText('edit my [[alp')
|
test: add tests for WikilinkChatInput and buildContextSnapshot
- WikilinkChatInput: 18 tests covering menu trigger, filtering, pill creation,
dedup, removal, keyboard nav, Enter select, send with refs, disabled state
- buildContextSnapshot: 10 tests for structured context JSON output
including activeNote, openTabs, vault summary, references, frontmatter
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 12:19:23 +01:00
|
|
|
|
2026-04-12 13:14:18 +02:00
|
|
|
fireEvent.keyDown(screen.getByTestId('agent-input'), { key: 'Enter' })
|
test: add tests for WikilinkChatInput and buildContextSnapshot
- WikilinkChatInput: 18 tests covering menu trigger, filtering, pill creation,
dedup, removal, keyboard nav, Enter select, send with refs, disabled state
- buildContextSnapshot: 10 tests for structured context JSON output
including activeNote, openTabs, vault summary, references, frontmatter
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 12:19:23 +01:00
|
|
|
|
2026-04-12 13:14:18 +02:00
|
|
|
expect(screen.getByTestId('inline-wikilink-chip')).toBeInTheDocument()
|
|
|
|
|
expect(onSend).not.toHaveBeenCalled()
|
test: add tests for WikilinkChatInput and buildContextSnapshot
- WikilinkChatInput: 18 tests covering menu trigger, filtering, pill creation,
dedup, removal, keyboard nav, Enter select, send with refs, disabled state
- buildContextSnapshot: 10 tests for structured context JSON output
including activeNote, openTabs, vault summary, references, frontmatter
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 12:19:23 +01:00
|
|
|
})
|
|
|
|
|
|
2026-04-12 13:14:18 +02:00
|
|
|
it('deletes an inline chip with a single Backspace', () => {
|
|
|
|
|
render(<Controlled />)
|
|
|
|
|
updateEditorText('edit my [[alp')
|
|
|
|
|
clickFirstSuggestion()
|
test: add tests for WikilinkChatInput and buildContextSnapshot
- WikilinkChatInput: 18 tests covering menu trigger, filtering, pill creation,
dedup, removal, keyboard nav, Enter select, send with refs, disabled state
- buildContextSnapshot: 10 tests for structured context JSON output
including activeNote, openTabs, vault summary, references, frontmatter
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 12:19:23 +01:00
|
|
|
|
2026-04-12 13:14:18 +02:00
|
|
|
const editor = screen.getByTestId('agent-input')
|
|
|
|
|
fireEvent.keyDown(editor, { key: 'Backspace' })
|
test: add tests for WikilinkChatInput and buildContextSnapshot
- WikilinkChatInput: 18 tests covering menu trigger, filtering, pill creation,
dedup, removal, keyboard nav, Enter select, send with refs, disabled state
- buildContextSnapshot: 10 tests for structured context JSON output
including activeNote, openTabs, vault summary, references, frontmatter
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 12:19:23 +01:00
|
|
|
|
2026-04-12 13:14:18 +02:00
|
|
|
expect(screen.queryByTestId('inline-wikilink-chip')).toBeNull()
|
test: add tests for WikilinkChatInput and buildContextSnapshot
- WikilinkChatInput: 18 tests covering menu trigger, filtering, pill creation,
dedup, removal, keyboard nav, Enter select, send with refs, disabled state
- buildContextSnapshot: 10 tests for structured context JSON output
including activeNote, openTabs, vault summary, references, frontmatter
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 12:19:23 +01:00
|
|
|
})
|
|
|
|
|
|
2026-04-12 13:14:18 +02:00
|
|
|
it('submits serialized wikilink text and resolved references', () => {
|
test: add tests for WikilinkChatInput and buildContextSnapshot
- WikilinkChatInput: 18 tests covering menu trigger, filtering, pill creation,
dedup, removal, keyboard nav, Enter select, send with refs, disabled state
- buildContextSnapshot: 10 tests for structured context JSON output
including activeNote, openTabs, vault summary, references, frontmatter
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 12:19:23 +01:00
|
|
|
const onSend = vi.fn()
|
2026-04-12 13:14:18 +02:00
|
|
|
render(<Controlled onSend={onSend} />)
|
test: add tests for WikilinkChatInput and buildContextSnapshot
- WikilinkChatInput: 18 tests covering menu trigger, filtering, pill creation,
dedup, removal, keyboard nav, Enter select, send with refs, disabled state
- buildContextSnapshot: 10 tests for structured context JSON output
including activeNote, openTabs, vault summary, references, frontmatter
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 12:19:23 +01:00
|
|
|
|
2026-04-12 13:14:18 +02:00
|
|
|
updateEditorText('edit my [[alpha]] essay')
|
test: add tests for WikilinkChatInput and buildContextSnapshot
- WikilinkChatInput: 18 tests covering menu trigger, filtering, pill creation,
dedup, removal, keyboard nav, Enter select, send with refs, disabled state
- buildContextSnapshot: 10 tests for structured context JSON output
including activeNote, openTabs, vault summary, references, frontmatter
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 12:19:23 +01:00
|
|
|
fireEvent.keyDown(screen.getByTestId('agent-input'), { key: 'Enter' })
|
|
|
|
|
|
2026-04-12 13:14:18 +02:00
|
|
|
expect(onSend).toHaveBeenCalledWith('edit my [[alpha]] essay', [
|
|
|
|
|
{ title: 'Alpha', path: '/vault/alpha.md', type: 'Project' },
|
|
|
|
|
])
|
test: add tests for WikilinkChatInput and buildContextSnapshot
- WikilinkChatInput: 18 tests covering menu trigger, filtering, pill creation,
dedup, removal, keyboard nav, Enter select, send with refs, disabled state
- buildContextSnapshot: 10 tests for structured context JSON output
including activeNote, openTabs, vault summary, references, frontmatter
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 12:19:23 +01:00
|
|
|
})
|
|
|
|
|
|
2026-04-12 13:14:18 +02:00
|
|
|
it('does not send on Shift+Enter', () => {
|
test: add tests for WikilinkChatInput and buildContextSnapshot
- WikilinkChatInput: 18 tests covering menu trigger, filtering, pill creation,
dedup, removal, keyboard nav, Enter select, send with refs, disabled state
- buildContextSnapshot: 10 tests for structured context JSON output
including activeNote, openTabs, vault summary, references, frontmatter
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 12:19:23 +01:00
|
|
|
const onSend = vi.fn()
|
2026-04-12 13:14:18 +02:00
|
|
|
render(<Controlled onSend={onSend} />)
|
test: add tests for WikilinkChatInput and buildContextSnapshot
- WikilinkChatInput: 18 tests covering menu trigger, filtering, pill creation,
dedup, removal, keyboard nav, Enter select, send with refs, disabled state
- buildContextSnapshot: 10 tests for structured context JSON output
including activeNote, openTabs, vault summary, references, frontmatter
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 12:19:23 +01:00
|
|
|
|
2026-04-12 13:14:18 +02:00
|
|
|
updateEditorText('hello')
|
|
|
|
|
fireEvent.keyDown(screen.getByTestId('agent-input'), { key: 'Enter', shiftKey: true })
|
test: add tests for WikilinkChatInput and buildContextSnapshot
- WikilinkChatInput: 18 tests covering menu trigger, filtering, pill creation,
dedup, removal, keyboard nav, Enter select, send with refs, disabled state
- buildContextSnapshot: 10 tests for structured context JSON output
including activeNote, openTabs, vault summary, references, frontmatter
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 12:19:23 +01:00
|
|
|
|
2026-04-12 13:14:18 +02:00
|
|
|
expect(onSend).not.toHaveBeenCalled()
|
test: add tests for WikilinkChatInput and buildContextSnapshot
- WikilinkChatInput: 18 tests covering menu trigger, filtering, pill creation,
dedup, removal, keyboard nav, Enter select, send with refs, disabled state
- buildContextSnapshot: 10 tests for structured context JSON output
including activeNote, openTabs, vault summary, references, frontmatter
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 12:19:23 +01:00
|
|
|
})
|
|
|
|
|
|
2026-04-12 13:14:18 +02:00
|
|
|
it('marks the editor disabled when disabled is true', () => {
|
|
|
|
|
render(<Controlled disabled />)
|
test: add tests for WikilinkChatInput and buildContextSnapshot
- WikilinkChatInput: 18 tests covering menu trigger, filtering, pill creation,
dedup, removal, keyboard nav, Enter select, send with refs, disabled state
- buildContextSnapshot: 10 tests for structured context JSON output
including activeNote, openTabs, vault summary, references, frontmatter
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 12:19:23 +01:00
|
|
|
|
2026-04-12 13:14:18 +02:00
|
|
|
const editor = screen.getByTestId('agent-input')
|
|
|
|
|
expect(editor).toHaveAttribute('contenteditable', 'false')
|
|
|
|
|
expect(editor).toHaveAttribute('aria-disabled', 'true')
|
test: add tests for WikilinkChatInput and buildContextSnapshot
- WikilinkChatInput: 18 tests covering menu trigger, filtering, pill creation,
dedup, removal, keyboard nav, Enter select, send with refs, disabled state
- buildContextSnapshot: 10 tests for structured context JSON output
including activeNote, openTabs, vault summary, references, frontmatter
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 12:19:23 +01:00
|
|
|
})
|
|
|
|
|
})
|