test: guard workbench action coverage
Some checks failed
StoryForge CI / Baseline checks (push) Has been cancelled
StoryForge CI / Backend tests (push) Has been cancelled
StoryForge CI / Web tests (push) Has been cancelled

This commit is contained in:
kris
2026-03-31 01:07:17 +08:00
parent 3f3c8de949
commit 7a928b5df9
2 changed files with 10 additions and 1 deletions

View File

@@ -797,3 +797,11 @@ test("live-first workbench flows no longer advertise stale missing-capability pl
assert.doesNotMatch(APP, /当前实例还没有开放平台技能验收接口/);
assert.doesNotMatch(APP, /当前实例未提供/);
});
test("declared static workbench actions are wired into explicit handlers", () => {
const declared = new Set([...APP.matchAll(/data-action="([a-zA-Z0-9_-]+)"/g)].map((match) => match[1]));
const clickHandled = new Set([...APP.matchAll(/if \(name === "([a-zA-Z0-9_-]+)"\)/g)].map((match) => match[1]));
const knownNonClick = new Set(["submit-auth", "submit-oneliner", "submit-sheet", "close-sheet", "close-auth", "close-oneliner", "discovery-query", "refresh-data"]);
const missing = [...declared].filter((name) => !clickHandled.has(name) && !knownNonClick.has(name)).sort();
assert.deepEqual(missing, []);
});