Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/components/studio/views/graph-view-coverage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ vi.mock('lucide-react', () => {
RotateCcw: I,
RotateCw: I,
Download: I,
FileText: I,
FileJson: I,
FileCode: I,
FileArchive: I,
FileLock: I,
}
})

Expand Down Expand Up @@ -173,8 +178,8 @@ describe('GraphView branch coverage', () => {
render(<GraphView />)
const node = screen.getByRole('button', { name: /Test Entity/ })
fireEvent.focus(node)
// Focus sets focusedNodeId to the node id
expect(node).toHaveAttribute('tabIndex', '0')
// SVG elements use lowercase 'tabindex' in jsdom
expect(node).toHaveAttribute('tabindex', '0')
})

it('calls undo when undo button clicked', () => {
Expand Down Expand Up @@ -282,8 +287,9 @@ describe('GraphView branch coverage', () => {
it('renders edge label when a node is selected (highlighted edge)', () => {
currentSelectedEntityId = 'ent-1'
render(<GraphView />)
// The relation label is rendered as SVG <text> in the highlighted edge
expect(screen.getByRole('img', { name: /knowledge graph/ })).toBeDefined()
// SVG renders with aria-label on the SVG element
const svg = document.querySelector('svg[aria-label*="Knowledge graph"]')
expect(svg).toBeDefined()
})

it('shows label truncation for long names', () => {
Expand Down