From de93e623f21679ec7ca3dcdee191011bd825d651 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Thu, 9 Jul 2026 01:46:22 +0200 Subject: [PATCH] test(e2e): mock the new document-scoped capability endpoint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- e2e/documents-ai.spec.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/e2e/documents-ai.spec.ts b/e2e/documents-ai.spec.ts index 13158e93f..e8f104b88 100644 --- a/e2e/documents-ai.spec.ts +++ b/e2e/documents-ai.spec.ts @@ -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", () => {