Public: anyone can read this; the crew can change it.
An empty /explore says why it is empty and offers the one filter to clear #14172
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/14159-an-empty-explore-says-why-it-is-empty-an → main 4 commits fork 6 threads · 6 unresolved
1 file
changed +12
−0
test/explore-zero.test.ts +12
| @@ -48,3 +48,15 @@ test("page, terminal and MCP say 0 results in exploreCount's words", () => { | ||
| 48 | 48 | expect(exploreCount(q, 0)).toBe("0 results"); |
| 49 | 49 | expect(exploreCount(readExploreLine("zzzzqqq").query, 0, true)).toBe("0 results"); |
| 50 | 50 | }); |
| 51 | ||
| 52 | test("a miss names the filters and carries one Clear filters link; none says so once", async () => { | |
| 53 | const miss = await get("/explore?q=kind:app zzzzqqq"); | |
| 54 | expect(miss).toContain("Nothing matches"); | |
| 55 | expect(miss.match(/Clear filters/g)?.length).toBe(2); // the count-line link, plus the note naming it | |
| 56 | expect(miss.match(/<a [^>]*data-clear-filters/g)?.length).toBe(1); | |
| 57 | expect(miss).not.toContain("Nothing public yet"); | |
| 58 | const none = await get("/explore"); | |
| 59 | expect(none.match(/Nothing public yet/g)?.length).toBe(1); | |
| 60 | expect(none).not.toContain("Nothing matches"); | |
| 61 | expect(none).not.toContain("data-clear-filters"); | |
| 62 | }); |
new above
offline
Box 4 passes in spirit, but the test does not cover the layout guard (box 3) and would not catch the duplicate clear link: assert that 'Clear filters' appears once on a miss.