e2e tests for slash/mentions in chat text area (#6022)

Co-authored-by: Kevin Bond <kevin@Kevins-MacBook-Pro.local>
This commit is contained in:
canvrnoandKevin Bond authored and GitHub committed 2025-09-04 22:46:23 -07:00
1 parent 64a8096f96
commit 5dfd16359d
1 file changed
+80
+80
View File
@@ -47,3 +47,83 @@ e2e("Chat - can send messages and switch between modes", async ({ helper, page,
await expect(sidebar.getByText("API Request Failed")).toBeVisible()
})
e2e("Chat - slash commands preserve following text", async ({ helper, page, sidebar }) => {
// Sign in
await helper.signin(sidebar)
const inputbox = sidebar.getByTestId("chat-input")
await expect(inputbox).toBeVisible()
// Type partial slash command to trigger menu
await inputbox.focus()
await inputbox.type("/new")
// Wait for menu to be visible and select first option with Tab
await inputbox.press("Tab")
await expect(inputbox).toHaveValue("/newtask ")
// Add following text to verify it works correctly
await inputbox.type("following text should be preserved")
await expect(inputbox).toHaveValue("/newtask following text should be preserved")
})
e2e("Chat - @ mentions preserve following text", async ({ helper, page, sidebar }) => {
// Sign in
await helper.signin(sidebar)
const inputbox = sidebar.getByTestId("chat-input")
await expect(inputbox).toBeVisible()
// Type partial @ mention to trigger menu
await inputbox.focus()
await inputbox.type("@prob")
// Wait for menu to be visible and select first option with Tab
await inputbox.press("Tab")
await expect(inputbox).toHaveValue("@problems ")
// Add following text to verify it works correctly
await inputbox.type("following text should be preserved")
await expect(inputbox).toHaveValue("@problems following text should be preserved")
})
e2e("Chat - partial slash command completion preserves text", async ({ helper, page, sidebar }) => {
// Sign in
await helper.signin(sidebar)
const inputbox = sidebar.getByTestId("chat-input")
await expect(inputbox).toBeVisible()
// Type partial slash command and complete it
await inputbox.focus()
await inputbox.type("/new")
// Complete the command with Tab
await inputbox.press("Tab")
await expect(inputbox).toHaveValue("/newtask ")
// Add following text after completion
await inputbox.type("some important text after")
await expect(inputbox).toHaveValue("/newtask some important text after")
})
e2e("Chat - partial @ mention completion preserves text", async ({ helper, page, sidebar }) => {
// Sign in
await helper.signin(sidebar)
const inputbox = sidebar.getByTestId("chat-input")
await expect(inputbox).toBeVisible()
// Type partial @ mention and complete it
await inputbox.focus()
await inputbox.type("@prob")
// Complete the mention with Tab
await inputbox.press("Tab")
await expect(inputbox).toHaveValue("@problems ")
// Add following text after completion
await inputbox.type("important content follows")
await expect(inputbox).toHaveValue("@problems important content follows")
})