Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion tests/ui-smoke.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2150,7 +2150,14 @@ test.describe("Clinical KB UI smoke coverage", () => {
await expect(documentResults).toContainText("Synthetic lithium monitoring protocol");
await expect(documentResults).toContainText("Best match");
await expect(documentResults).toContainText("Tables 1");
await expect(documentResults.getByRole("link", { name: "Open document" }).first()).toBeVisible();
const openDocumentLink = documentResults.getByRole("link", { name: "Open document" }).first();
await expect(openDocumentLink).toBeVisible();
// Exact viewer target built from mockDemoApi's lithium result (document_id / bestPages[0] /
// bestChunkIds[0]): a link to the wrong document, page, or chunk must fail this assertion.
await expect(openDocumentLink).toHaveAttribute(
"href",
"/documents/11111111-1111-4111-8111-111111111111?page=1&chunk=44444444-4444-4444-8444-444444444442",
);
await expect(page.getByRole("complementary").filter({ hasText: "Selected source" })).toHaveCount(0);
await expectNoPageHorizontalOverflow(page);
});
Expand Down