fix: flaky e2e test for slash commands (#7206)

* fix: flaky e2e test for slash commands

* use click

* @problems

* newtask click

* exact: false

* exact: false

* revert unrelated change
This commit is contained in:
Bee authored and GitHub committed 2025-11-04 12:43:29 -08:00
1 parent 59260cefab
commit 8215d3fdb9
1 file changed
+7 -9
+7 -9
View File
@@ -34,13 +34,11 @@ e2e("Chat - can send messages and switch between modes", async ({ helper, sideba
// === slash commands preserve following text ===
await expect(inputbox).toHaveValue("")
// Type partial slash command to trigger menu
await inputbox.pressSequentially("/new", { delay: 100 })
await inputbox.fill("/newt")
// Wait for the slash commands menu to be visible
await sidebar.getByTestId("slash-commands-menu").waitFor({ state: "visible" })
// Wait for menu to be visible and select first option with Tab
await inputbox.press("Tab")
// Wait for menu to be visible and click on menu item
await inputbox.focus()
await sidebar.getByText("newtask", { exact: false }).click()
await expect(inputbox).toHaveValue("/newtask ")
// Add following text to verify it works correctly
@@ -52,10 +50,10 @@ e2e("Chat - can send messages and switch between modes", async ({ helper, sideba
await expect(inputbox).toHaveValue("")
// Type partial @ mention to trigger menu
await inputbox.pressSequentially("@prob")
await inputbox.fill("@prob")
// Wait for menu to be visible and select first option with Tab
await inputbox.press("Tab")
// Wait for menu to be visible and click on menu item
await sidebar.getByText("Problems", { exact: false }).first().click()
await expect(inputbox).toHaveValue("@problems ")
// Add following text to verify it works correctly