test(e2e): mock the new document-scoped capability endpoint

v1.27.31 routed the document AI section through a new document-scoped
capability probe (/api/documents/inbound/capability) instead of the labs
OCR probe. The AI-flow e2e helper only mocked the old probe, so the section
fell back to unavailable and the assist actions never rendered — the tests
timed out waiting for them. Mock the new endpoint with matching availability;
egress-notice behaviour is covered by the SSR component test.
This commit is contained in:
Marc-André Bombeck committed 2026-07-09 01:46:22 +02:00
1 parent e1a8da5dfb
commit de93e623f2
1 file changed
+16
+16
View File
@@ -94,6 +94,22 @@ async function mockAiEnabled(
error: null,
}),
);
// v1.27.31 — the document AI section now probes the document-scoped
// capability endpoint (provider order + vendor-blind egress class), not the
// labs OCR probe. Mirror the same availability so the AI actions render;
// egress-notice-specific tests override this route afterwards.
await page.route("**/api/documents/inbound/capability", (route) =>
fulfilJson(route, {
data: {
available: true,
mode: opts.mode,
reason: null,
pdfSupported: opts.pdfSupported ?? opts.mode === "vision",
egress: "external",
},
error: null,
}),
);
}
test.describe("document vault — AI assist + content search", () => {