mirror of
https://github.com/stablyai/orca.git
synced 2026-11-18 20:06:10 +00:00
refactor(settings): narrow retained editor element types
This commit is contained in:
@@ -71,7 +71,7 @@ it('retains a focused unsaved command and selection across asynchronous membersh
|
||||
const save = vi.fn()
|
||||
const view = render(catalog(false, save))
|
||||
fireEvent.click(screen.getByRole('button', { name: 'Claude' }))
|
||||
const input = screen.getByDisplayValue('claude') as HTMLInputElement
|
||||
const input = screen.getByDisplayValue<HTMLInputElement>('claude')
|
||||
input.focus()
|
||||
fireEvent.change(input, { target: { value: '/custom/unsaved-claude' } })
|
||||
input.setSelectionRange(3, 9, 'backward')
|
||||
@@ -109,7 +109,7 @@ it('keeps a pending save attached to the same editor when membership changes', a
|
||||
)
|
||||
const view = render(catalog(false, save))
|
||||
fireEvent.click(screen.getByRole('button', { name: 'Claude' }))
|
||||
const input = screen.getByDisplayValue('claude') as HTMLInputElement
|
||||
const input = screen.getByDisplayValue<HTMLInputElement>('claude')
|
||||
fireEvent.change(input, { target: { value: '/custom/claude' } })
|
||||
fireEvent.keyDown(input, { key: 'Enter' })
|
||||
await waitFor(() => expect(input.readOnly).toBe(true))
|
||||
|
||||
@@ -29,9 +29,8 @@ export function createAgentCatalogRowHost(): {
|
||||
}
|
||||
const atomic =
|
||||
element.isConnected && parent.isConnected && typeof parent.moveBefore === 'function'
|
||||
const active = element.contains(document.activeElement)
|
||||
? (document.activeElement as HTMLElement)
|
||||
: null
|
||||
const focused = document.activeElement
|
||||
const active = focused instanceof HTMLElement && element.contains(focused) ? focused : null
|
||||
const selection =
|
||||
active instanceof HTMLInputElement || active instanceof HTMLTextAreaElement
|
||||
? {
|
||||
|
||||
Reference in New Issue
Block a user