From ec45e7318ca5fdff6dd35253fe9c03e09d51ae7b Mon Sep 17 00:00:00 2001 From: ABAPPLO <1134226402@qq.com> Date: Mon, 28 Sep 2026 13:48:37 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E9=97=A8=E6=88=B7=E5=AE=88=E5=8D=AB?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E5=AF=B9=E9=BD=90=E4=BB=BB=E5=8A=A1=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B=E7=89=A9=E7=90=86=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit e2a93e2 将 screenshot_collect 并入单任务双阶段(先发布后回收截图)时漏改 koc-portal/tests,两条源码守卫断言失配导致 CI 失败: - note-index 完成态改为仅看 publish_url 的单分支断言 - 截图任务用例改为合并后的回收截图模型:recoveryEnabled 守卫、 先回填发布链接再传截图的门槛、批次回收进度、回收示例图, 并加 doesNotMatch 防止回退 screenshot_collect/isScreenshotTask 旧模型 --- koc-portal/tests/rendered-html.test.mjs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/koc-portal/tests/rendered-html.test.mjs b/koc-portal/tests/rendered-html.test.mjs index 91f637c..016ebac 100644 --- a/koc-portal/tests/rendered-html.test.mjs +++ b/koc-portal/tests/rendered-html.test.mjs @@ -106,7 +106,7 @@ test("keeps claiming minimal and backfill one-to-one", async () => { assert.match(page, /placeholder="填写截图中的曝光量"\s*\/>/); assert.match(page, /placeholder="填写截图中的阅读量"\s*\/>/); assert.doesNotMatch(page, /recognizeCreatorMetrics/); - assert.match(page, /note-index \$\{\(isScreenshotTask \? item\.result_submitted_at : item\.publish_url\) \? "done" : ""\}/); + assert.match(page, /note-index \$\{item\.publish_url \? "done" : ""\}/); assert.match(packageJson, /"fflate":\s*"0\.7\.4"/); assert.doesNotMatch(packageJson, /tesseract\.js/); assert.match(layout, /逐篇查看笔记详情并一一回填/); @@ -118,18 +118,24 @@ test("keeps claiming minimal and backfill one-to-one", async () => { await access(new URL("../public/favicon.svg", import.meta.url)); }); -test("renders screenshot-only tasks with anonymous delegation and multi-image uploads", async () => { +test("renders merged task recovery screenshots with anonymous delegation and multi-image uploads", async () => { const [page, styles] = await Promise.all([ readFile(new URL("../app/page.tsx", import.meta.url), "utf8"), readFile(new URL("../app/globals.css", import.meta.url), "utf8"), ]); - assert.match(page, /screenshot_collect/); - assert.match(page, /小红书搜索关键词/); - assert.match(page, /上传小红书 AI 总结截图/); + assert.match(page, /payload\.task\.recoveryEnabled/); + assert.doesNotMatch(page, /screenshot_collect|isScreenshotTask/); + assert.match(page, /上传发布后的笔记截图/); + assert.match(page, /recoveryInstructions \|\| "请提交发布后的笔记截图"/); + assert.match(page, /回收示例截图/); assert.match(page, /submit_screenshot_result/); + assert.match(page, /submitRecoveryScreenshots/); + assert.match(page, /请先回填这篇笔记的发布链接,再提交回收截图/); + assert.match(page, /回填发布链接后,这里会开放回收截图上传。/); + assert.match(page, /截图已收/); + assert.match(page, /更新回收截图/); assert.match(page, /"task-result"/); - assert.match(page, /不需要填写发布链接或其他数据/); assert.match(page, /multiple/); assert.match(page, /taskResultScreenshots/); assert.match(page, /task-result-thumb/); @@ -138,6 +144,7 @@ test("renders screenshot-only tasks with anonymous delegation and multi-image up assert.match(styles, /\.task-result-gallery/); assert.match(styles, /\.image-lightbox/); assert.match(styles, /\.evidence-preview-button/); + assert.match(styles, /\.recovery-progress/); }); test("shows D1 and MySQL UTC timestamps in Beijing time", () => {