diff options
| author | Joe Mou <dev@mou.fo> | 2026-09-21 22:15:24 -0400 |
|---|---|---|
| committer | Joe Mou <dev@mou.fo> | 2026-09-25 01:43:53 -0400 |
| commit | 1514865ec8911c26612e68048f84c6c8be92449d (patch) | |
| tree | 07a24c2b0536e4fd3b69c1cbc2a424e9ee25aa8a /src/app.test.ts | |
| parent | fd1c054c3c10dceb1a8a355c74a0d9e9077aae19 (diff) | |
Show issue and pull request status and labels in their lists
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'src/app.test.ts')
| -rw-r--r-- | src/app.test.ts | 37 |
1 files changed, 37 insertions, 0 deletions
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, /<span class="pill state state-closed">Closed<\/span>/); + assert.match(issues, /<span class="pill state state-open">Open<\/span>/); + assert.match(issues, /<a href="\/cli\/cli\/issues\/10000">\s+Forking is disabled/); + assert.match(issues, /<span class="pill-dot" style="background: #d73a4a"><\/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, /<span class="pill state state-merged">Merged<\/span>/); + assert.match(pulls, /<span class="pill state state-draft">Draft<\/span>/); + assert.match(pulls, /<a href="\/cli\/cli\/pull\/10000">/); + }); + it("should render the issue above its timeline", () => { const html = eta.render("issue.eta", issue); |
