mirror of
https://github.com/NeuralNomadsAI/CodeNomad.git
synced 2026-11-16 13:11:03 +00:00
test(ui): await the agent shortcut popup focus end state
The shortcut first focuses a hidden combobox input, opens its popup after 10 ms, and moves focus to its visible search. Sampling the intermediate input focus races normal popup opening. Assert that the visible agent search opens and receives focus, then that Escape closes it, for both the conversation composer and the first-session composer. The selector and sidebar shortcut implementation is unchanged from dev; no product delay or weaker focus assertion is introduced.
This commit is contained in:
parent
ab787cc3e6
commit
ee92f7e385
1 changed files with 6 additions and 2 deletions
|
|
@ -910,8 +910,12 @@ test("Clear and selector shortcuts drive the shown composer, in a conversation a
|
|||
assert.equal(await send.isEnabled(), false)
|
||||
assert.equal(await composer.evaluate(element => element === document.activeElement), true)
|
||||
await page.keyboard.press("Control+Shift+A")
|
||||
await page.waitForFunction(() => document.activeElement?.hasAttribute("data-agent-selector"))
|
||||
await page.keyboard.press("Escape")
|
||||
// The hidden combobox input owns focus only until the popup opens.
|
||||
const agentSearch = page.locator('.selector-search-input[placeholder="Select agent..."]:visible')
|
||||
await agentSearch.waitFor()
|
||||
await page.waitForFunction(() => document.activeElement?.matches('.selector-search-input[placeholder="Select agent..."]'))
|
||||
await page.keyboard.press("Escape")
|
||||
await agentSearch.waitFor({ state: "hidden" })
|
||||
await page.evaluate(() => (window as any).fixture.selectSession(null))
|
||||
}
|
||||
} finally { await page.close() }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue