From 226984ad63b063c362e18260a591a3f9a035a8d3 Mon Sep 17 00:00:00 2001 From: Joe Mou Date: Fri, 25 Sep 2026 01:48:21 -0400 Subject: Show each repo nav item only if the GitHub page includes it Co-Authored-By: Claude Opus 5.5 --- src/app.test.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/app.test.ts') diff --git a/src/app.test.ts b/src/app.test.ts index 59a2c61..e870666 100644 --- a/src/app.test.ts +++ b/src/app.test.ts @@ -92,6 +92,26 @@ describe("sidebar fragment", () => { }); }); +describe("repository navigation", () => { + const releases = { repo: { owner: "torvalds", name: "linux" }, releases: [] }; + + it("should only link to the tabs GitHub shows", () => { + const html = eta.render("releases.eta", { ...releases, tabs: ["code", "actions", "wiki"] }); + + assert.match(html, /href="\/torvalds\/linux\/wiki"/); + assert.doesNotMatch(html, /href="\/torvalds\/linux\/issues"/); + assert.doesNotMatch(html, /href="\/torvalds\/linux\/pulls"/); + assert.doesNotMatch(html, /href="\/torvalds\/linux\/discussions"/); + }); + + it("should link to every tab without GitHub's navigation to go by", () => { + const html = eta.render("releases.eta", { ...releases, tabs: null }); + + assert.match(html, /href="\/torvalds\/linux\/issues"/); + assert.match(html, /href="\/torvalds\/linux\/wiki"/); + }); +}); + describe("blob view", () => { const blob = { repo: { owner: "justrajdeep", name: "fonts" }, -- cgit v1.3.1