Repository navigation
feat: wire chat search box to full-text search #27973
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
7fc93ab
2ee34e5
86445a0
026020b
3132d51
1fcef68
5a925b1
f0bd801
4a47b35
b1846b7
450d239
dbfde13
60a3a6d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| import { expect, test } from "@playwright/test"; | ||
| import { login } from "../../helpers"; | ||
| import { beforeCoderTest } from "../../hooks"; | ||
|
|
||
| test.beforeEach(async ({ page }) => { | ||
| beforeCoderTest(page); | ||
| await login(page); | ||
| }); | ||
|
|
||
| test("searches chats with backend full-text search", async ({ page }) => { | ||
| await page.goto("/agents", { waitUntil: "domcontentloaded" }); | ||
|
|
||
| await page.getByRole("button", { name: "Search chats" }).first().click(); | ||
| const searchInput = page.getByRole("combobox", { name: "Search chats" }); | ||
| await expect(searchInput).toBeVisible(); | ||
|
|
||
| const searchResponse = page.waitForResponse((response) => { | ||
| const url = new URL(response.url()); | ||
| return ( | ||
| url.pathname === "/api/experimental/chats" && | ||
| url.searchParams.get("q") === 'search:"full-text-smoke"' | ||
| ); | ||
| }); | ||
| await searchInput.fill("full-text-smoke"); | ||
|
|
||
| await expect((await searchResponse).status()).toBe(200); | ||
| await expect(page.getByRole("alert")).not.toBeVisible(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note [CRF-54] The Playwright's negative visibility assertion succeeds immediately when the element is absent, and react-query settles after the network response, so an alert rendering a frame later would not fail the test. Harmless here because the asserted response is 200 and no error alert can derive from it, but do not lean on this line as error-path coverage later; a
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed. The e2e spec now waits for the rendered no-results state before asserting no alert is visible, so the alert-absence check is no longer vacuous.
|
||
| }); | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P3 [CRF-41] The cross-language contract table misses a live sidebar emitter shape:
archived:false has_unread:true. (Bisky)getChatListQueryStringemitshas_unread:${...}whenparams.status !== "all"(chats.ts:995), reachable fromAgentsPageLayout.tsx:220-228via the sidebar filters. NeitherTestSearchChatsFrontendEmittednor the newchats.test.tspin includes it. The whole point of this contract test is that every emitter shape appears on both sides; a shape that exists in production but not in the table is the exact hole the test was built to close. AddgetChatListQueryString(toChatListParams({ chatStatus: "unread" }))expectingarchived:false has_unread:trueto chats.test.ts, and the matching row to the Go table.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. Added the archived:false has_unread:true shape to both the Go contract table and the chats.test.ts shape test, so the unread-sidebar emitter is now pinned on both sides.