mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-11 05:42:19 +00:00
test(e2e): surface the provenance card via search; anchor the auto-read sheet on its footer
The virtualized vault grid only mounts cards near the viewport, so the provenance marker must be brought into view the way a user would — through the content search that already backs the neighbouring spec. The auto-read sheet assertion anchors on the footer's download action (rendered only once the document GET resolved) so the absence checks cannot pass vacuously against the loading skeleton.
This commit is contained in:
1 parent
869f5e561b
commit
3da6c781ed
2 files changed
+23
-10
No files matched your search
@@ -357,18 +357,26 @@ test.describe("document vault — AI assist + content search", () => {
|
||||
page,
|
||||
}) => {
|
||||
// CONTENT_DOC_ID is seeded with source "vision" (an AI provider read it).
|
||||
// No mocks: the real list/detail GET threads the provenance through.
|
||||
await page.goto(`/documents?doc=${CONTENT_DOC_ID}`);
|
||||
const sheet = page.getByRole("dialog");
|
||||
await expect(sheet).toBeVisible();
|
||||
// No mocks: the real list GET threads the provenance through. v1.28.22 —
|
||||
// the marker lives on the vault CARD's meta row (an inline glyph beside
|
||||
// date · size), not in the sheet. Surface the card through search (the
|
||||
// grid is virtualized, so a targeted card must be brought into view the
|
||||
// way a user would).
|
||||
await page.goto("/documents");
|
||||
await expect(
|
||||
page.getByRole("heading", { name: "Documents" }),
|
||||
).toBeVisible();
|
||||
await page
|
||||
.getByRole("searchbox", { name: "Search documents" })
|
||||
.fill(CONTENT_BODY_WORD);
|
||||
await expect(
|
||||
page.getByRole("button", { name: "Open Radiology note" }),
|
||||
).toBeVisible({ timeout: 10_000 });
|
||||
|
||||
// v1.28.22 — the provenance marker moved out of the sheet onto the vault
|
||||
// card's meta row (an inline glyph beside date · size). The sheet carries
|
||||
// no status chrome; the CARD is the provenance contract now.
|
||||
const marker = page.locator(
|
||||
`[data-document-id="${CONTENT_DOC_ID}"] [data-slot="document-card-ai-read"]`,
|
||||
);
|
||||
await expect(marker.first()).toBeAttached();
|
||||
await expect(marker.first()).toBeVisible();
|
||||
});
|
||||
|
||||
// ── (f) Text-mode refuses a non-image before any OCR/upload ──────────────
|
||||
|
||||
@@ -262,8 +262,13 @@ test.describe("automatic AI reading — vault per-document contract", () => {
|
||||
|
||||
// v1.28.22 — with auto-read ON and nothing pending the WHOLE block
|
||||
// collapses (no status chrome; provenance lives on the vault card), so the
|
||||
// sheet content starts straight with the document fields.
|
||||
await expect(sheet.locator("form")).toBeVisible();
|
||||
// sheet content starts straight with the document fields. The footer's
|
||||
// download action is the loaded-state anchor (it renders only once the
|
||||
// document GET resolved), so the absence checks below cannot pass
|
||||
// vacuously against the loading skeleton.
|
||||
await expect(
|
||||
sheet.locator('[data-slot="document-download"]'),
|
||||
).toBeVisible();
|
||||
await expect(
|
||||
sheet.locator('[data-slot="document-ai-section"]'),
|
||||
).toHaveCount(0);
|
||||
|
||||
Reference in new issue
Block a user