Merge pull request #150 from Vasanthdev2004/slash-highlight-fix
fix: make selected slash suggestion visibly highlighted
This commit is contained in:
@@ -0,0 +1,36 @@
|
|||||||
|
import figures from 'figures'
|
||||||
|
import React from 'react'
|
||||||
|
import { describe, expect, it } from 'bun:test'
|
||||||
|
import { renderToString } from '../../utils/staticRender.js'
|
||||||
|
import {
|
||||||
|
PromptInputFooterSuggestions,
|
||||||
|
type SuggestionItem,
|
||||||
|
} from './PromptInputFooterSuggestions.js'
|
||||||
|
|
||||||
|
describe('PromptInputFooterSuggestions', () => {
|
||||||
|
it('renders a visible marker for the selected suggestion', async () => {
|
||||||
|
const suggestions: SuggestionItem[] = [
|
||||||
|
{
|
||||||
|
id: 'command-help',
|
||||||
|
displayText: '/help',
|
||||||
|
description: 'Show help',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'command-doctor',
|
||||||
|
displayText: '/doctor',
|
||||||
|
description: 'Run diagnostics',
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
const output = await renderToString(
|
||||||
|
<PromptInputFooterSuggestions
|
||||||
|
suggestions={suggestions}
|
||||||
|
selectedSuggestion={1}
|
||||||
|
/>,
|
||||||
|
80,
|
||||||
|
)
|
||||||
|
|
||||||
|
expect(output).toContain(`${figures.pointer} /doctor`)
|
||||||
|
expect(output).toContain(' /help')
|
||||||
|
})
|
||||||
|
})
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user