From 5e7fb240c3ed52cddad61db79ca0b522172dc73e Mon Sep 17 00:00:00 2001 From: WeiCHEN Date: Tue, 22 Sep 2026 23:11:00 +0800 Subject: [PATCH] fix(e2e): accept bd_intake task_key for UI-05b intake runs Server posts doc_proj suffix (bd_intake) as task_key; bare intake assertion was a false FAIL after UI-05a. --- web/e2e/document-revision-runtime.spec.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/web/e2e/document-revision-runtime.spec.ts b/web/e2e/document-revision-runtime.spec.ts index aa4b85a9..3379ffe5 100644 --- a/web/e2e/document-revision-runtime.spec.ts +++ b/web/e2e/document-revision-runtime.spec.ts @@ -558,8 +558,16 @@ function assertIntakeTaskRun(res: Response, expectedDocId: string, caseId: strin fail(`${caseId} tasks/runs must be 2xx, got HTTP ${status}`); } const body = res.request().postDataJSON() as { task_key?: string; doc_id?: string }; - if (body.task_key !== 'intake') { - fail(`${caseId} task_key must be intake, got ${JSON.stringify(body.task_key)}`); + // Server task_key is the doc_proj* suffix (e.g. bd_intake), not the bare template token. + const expectedKey = expectedDocId.replace(/^doc_proj\d+_/, '') || 'intake'; + const keyOk = + body.task_key === expectedKey || + body.task_key === 'intake' || + (typeof body.task_key === 'string' && /(?:^|_)intake$/.test(body.task_key)); + if (!keyOk) { + fail( + `${caseId} task_key must be intake-family (expected ${JSON.stringify(expectedKey)}), got ${JSON.stringify(body.task_key)}`, + ); } if (!expectedDocId || body.doc_id !== expectedDocId) { fail(`${caseId} doc_id must be ${expectedDocId}, got ${JSON.stringify(body.doc_id)}`);