From 1514865ec8911c26612e68048f84c6c8be92449d Mon Sep 17 00:00:00 2001 From: Joe Mou Date: Mon, 21 Sep 2026 22:15:24 -0400 Subject: Show issue and pull request status and labels in their lists Co-Authored-By: Claude Opus 5 --- src/app.test.ts | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'src/app.test.ts') diff --git a/src/app.test.ts b/src/app.test.ts index 2211adf..59a2c61 100644 --- a/src/app.test.ts +++ b/src/app.test.ts @@ -409,6 +409,43 @@ describe("issues", () => { hiddenItems: 0, }; + it("should render the state and labels of every row of a list", () => { + const rows = [ + { + number: 10000, + title: "Forking is disabled", + state: "CLOSED", + createdAt: "2024-12-03T23:01:40Z", + labels: [label], + }, + { + number: 10001, + title: "Add a flag", + state: "OPEN", + createdAt: "2024-12-04T10:00:00Z", + labels: [], + }, + ]; + + const issues = eta.render("issues.eta", { repo, issues: rows }); + assert.match(issues, /Closed<\/span>/); + assert.match(issues, /Open<\/span>/); + assert.match(issues, /\s+Forking is disabled/); + assert.match(issues, /<\/span>bug/); + + // A pull request is also merged or a draft, and links to its own page. + const pulls = eta.render("pulls.eta", { + repo, + pulls: [ + { ...rows[0], state: "MERGED" }, + { ...rows[1], state: "DRAFT" }, + ], + }); + assert.match(pulls, /Merged<\/span>/); + assert.match(pulls, /Draft<\/span>/); + assert.match(pulls, //); + }); + it("should render the issue above its timeline", () => { const html = eta.render("issue.eta", issue); -- cgit v1.3.1