Quiet the Tidy up banner once a tidy-up finds nothing

AI Assisted
This commit is contained in:
jparkerweb committed 2026-11-29 21:15:46 -08:00
1 parent 634e4df10e
commit ee530d36c0
9 files changed
+148 -8

No files matched your search

@@ -282,6 +282,17 @@ test("the banner nudges a tidy-up when lessons are near their limit, and only th
assert.equal(await below.main.locator(".learn-banner").count(), 0, "no banner below the line");
});
test("Not now hides the tidy-up nudge at once and it stays hidden for the same lessons", async (t) => {
const full = await dashboard(t, { ...PROJECT("on"), ".plan2code/lessons/general.md": lessonFile("General", 22) });
const banner = full.main.locator(".learn-banner");
await banner.waitFor();
await banner.getByRole("button", { name: "Not now" }).click();
await until(async () => (await full.main.locator(".learn-banner").count()) === 0, 5000);
const state = await full.s.page.evaluate(() => fetch("/learning/state").then((r) => r.json()));
assert.equal(state.nearCap, false, "the server remembers it");
assert.equal(await full.main.locator(".learn-banner").count(), 0, "still hidden after the repaint");
});
test("a launch from a dashboard showing lessons waiting carries fromBanner", async (t) => {
const { s, main } = await dashboard(t, PROJECT("on"), (p) =>
writeWaiting(p, { id: "20261113-120000-eeeeee", type: "lesson", text: "Waits.", noted: new Date().toISOString() })