Files
mini-openclaw-v2/scripts/test_resetdata_ui.cjs
T
qiaoqichaoandClaude Code bf0549a4d3 fix(v2): 补齐 backend 单测依赖的两个 cjs 脚本
test_chat_repair.py:92 会调用 scripts/test_chat_stream.cjs,而该脚本不在
verify.py 的 9 个用例里,首轮抽取因此漏掉,导致 backend-unit 失败。
同时补上 test_resetdata_ui.cjs 使 cjs 测试集完整。

验证:scripts/verify.py 全部 9 项 PASS(backend-unit 124 tests OK)。

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-29 13:12:30 +08:00

14 lines
1.0 KiB
JavaScript

const fs=require("fs"),assert=require("assert");
const page=fs.readFileSync("src/app/resetdata/page.tsx","utf8");
const nav=fs.readFileSync("src/components/xingbang/AgentNav.tsx","utf8");
const layout=fs.readFileSync("src/app/resetdata/layout.tsx","utf8");
assert(page.includes('/demo/reset'),"reset page must call the scoped demo reset API");
assert(page.includes('RESET-DEMO-A-B-C'),"reset confirmation must remain explicit");
assert(page.includes('window.confirm'),"reset must have a human confirmation step");
assert(page.includes('window.alert'),"reset result must be visible without adding page controls");
assert((page.match(/<button/g)||[]).length===1,"reset page must contain exactly one button");
assert(!page.includes('AgentNav'),"reset page must not expose application navigation");
assert(!nav.includes('/resetdata')&&!nav.includes('演示复位'),"navigation must not expose reset page");
assert(layout.includes('index:false')&&layout.includes('follow:false'),"reset page must opt out of search indexing");
console.log("resetdata UI checks passed");