mirror of
https://github.com/jparkerweb/plan2code.git
synced 2026-11-29 05:11:19 -08:00
Give Help a Review Loop topic and open it from both Review Loop links
AI Assisted
This commit is contained in:
1 parent
bcb6e43dbd
commit
e0f82cc36b
12 files changed
+152
-14
No files matched your search
@@ -693,15 +693,17 @@ test("the favicon is served as an SVG with a PNG fallback and the page points at
|
||||
/* ---------------------------------------------------------------- help */
|
||||
|
||||
|
||||
test("help: 23 tabs with unique ids", () => {
|
||||
assert.equal(HELP_TABS.length, 23);
|
||||
assert.equal(new Set(HELP_TABS.map((t) => t.id)).size, 23);
|
||||
test("help: 24 tabs with unique ids", () => {
|
||||
assert.equal(HELP_TABS.length, 24);
|
||||
assert.equal(new Set(HELP_TABS.map((t) => t.id)).size, 24);
|
||||
assert.ok(Object.isFrozen(HELP_TABS) && HELP_TABS.every((t) => Object.isFrozen(t)), "the tab list is frozen");
|
||||
const ids = HELP_TABS.map((t) => t.id);
|
||||
assert.equal(ids.indexOf("learning"), ids.indexOf("dashboard") + 1, "Learning comes right after The dashboard");
|
||||
assert.equal(ids.indexOf("loop"), ids.indexOf("build") + 1, "Implementation Loop comes right after Watching a build");
|
||||
assert.equal(HELP_TABS[ids.indexOf("loop")].label, "Implementation Loop");
|
||||
assert.equal(ids.indexOf("git"), ids.indexOf("loop") + 1, "The git board comes right after Implementation Loop");
|
||||
assert.equal(ids.indexOf("review-loop"), ids.indexOf("loop") + 1, "Review Loop comes right after Implementation Loop");
|
||||
assert.equal(HELP_TABS[ids.indexOf("review-loop")].label, "Review Loop");
|
||||
assert.equal(ids.indexOf("git"), ids.indexOf("review-loop") + 1, "The git board comes right after Review Loop");
|
||||
assert.equal(HELP_TABS[ids.indexOf("git")].label, "The git board");
|
||||
assert.equal(helpTabFor({ workflow: "git" }), "git");
|
||||
assert.equal(ids.indexOf("deps"), ids.indexOf("git") + 1, "Update dependencies comes right after The git board");
|
||||
|
||||
@@ -405,6 +405,23 @@ test("help: the stuck tab is second, and openHelpOn only opens a tab that exists
|
||||
assert.match(opener[1], /HELP_TABS\.some\(/, "openHelpOn only opens a tab that exists");
|
||||
});
|
||||
|
||||
// A link that names a topic Help lacks falls back to wherever Help opened, so
|
||||
// each loop's "How it works" link must open a topic of its own that exists.
|
||||
test("help: each loop's link opens its own Help topic", () => {
|
||||
const ids = HELP_TABS.map((t) => t.id);
|
||||
assert.ok(ids.includes("review-loop"), "Help has a Review Loop topic");
|
||||
assert.equal(HELP_TABS[ids.indexOf("review-loop")].label, "Review Loop");
|
||||
const dash = publicSource("screens/dashboard.js");
|
||||
const link = dash.match(/function loopHelpLink\(entry\) \{([\s\S]*?)\n\}/);
|
||||
assert.ok(link, "dashboard.js has loopHelpLink");
|
||||
assert.match(link[1], /openHelpOn\(review \? "review-loop" : "loop"\)/, "the dashboard's Review Loop link opens Review Loop, the other opens Implementation Loop");
|
||||
const setup = publicSource("screens/review-loop-setup.js");
|
||||
assert.match(setup, /"How the Review Loop works"/, "the Review Loop setup screen names its own loop");
|
||||
assert.match(setup, /openHelpOn\("review-loop"\)/, "the Review Loop setup screen opens Review Loop");
|
||||
assert.doesNotMatch(setup, /openHelpOn\("loop"\)/, "the Review Loop setup screen never opens Implementation Loop");
|
||||
assert.match(publicSource("screens/loop-setup.js"), /openHelpOn\("loop"\)/, "the Implementation Loop setup still opens Implementation Loop");
|
||||
});
|
||||
|
||||
test("models: the page's built-in rows match the shipped agent list's builtins", () => {
|
||||
const app = publicSource("screens/agents/agents-data.js");
|
||||
const list = (src) => JSON.parse(src.match(/const MODEL_CLIS = (\[[^\]]*\]);/)[1]);
|
||||
|
||||
Reference in new issue
Block a user