test: guard workbench action coverage
This commit is contained in:
@@ -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, []);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user