aboutsummaryrefslogtreecommitdiff
path: root/src/app.test.ts
diff options
context:
space:
mode:
authorJoe Mou <dev@mou.fo>2026-09-25 01:48:21 -0400
committerJoe Mou <dev@mou.fo>2026-09-25 02:15:02 -0400
commit226984ad63b063c362e18260a591a3f9a035a8d3 (patch)
tree01d6a69ee1ba5234d74c83e78b0c85e44dc07904 /src/app.test.ts
parent181830285ac128ce0b5946b1c5d4e45fa51612ed (diff)
Show each repo nav item only if the GitHub page includes it
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'src/app.test.ts')
-rw-r--r--src/app.test.ts20
1 files changed, 20 insertions, 0 deletions
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" },