diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-03-16 21:30:36 +0000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-03-16 21:30:36 +0000 |
| commit | 1b6b27357c817359574605b854f6468917da314d (patch) | |
| tree | 1e03e989fa91a09bc8c93b8727ad454baa6e7e12 /web/test/deployment-badge.test.mjs | |
| parent | 0e4cd564d4c3819f487e4b7469c410d485e42dec (diff) | |
fix: hide deployment badge when not deployed and trim notification button label
- Deployment badge now returns null (hidden) when includes_fix is false instead of showing "Not deployed" noise
- Badge also suppressed when fix_commits is empty (no tracked commits to check)
- Notification button label trimmed to just the bell emoji
- Preamble: warn agents not to use absolute paths in git commands (sandbox bypass)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'web/test/deployment-badge.test.mjs')
| -rw-r--r-- | web/test/deployment-badge.test.mjs | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/web/test/deployment-badge.test.mjs b/web/test/deployment-badge.test.mjs index afb4a59..438fb27 100644 --- a/web/test/deployment-badge.test.mjs +++ b/web/test/deployment-badge.test.mjs @@ -33,8 +33,14 @@ describe('renderDeploymentBadge', () => { assert.equal(el, null); }); - it('returns element with deployment-badge class for valid status', () => { - const status = { deployed_commit: 'abc123', fix_commits: [], includes_fix: false }; + it('returns null when includes_fix is false', () => { + const status = { deployed_commit: 'abc123', fix_commits: [{ hash: 'aabbcc', message: 'fix' }], includes_fix: false }; + const el = renderDeploymentBadge(status, makeDoc()); + assert.equal(el, null); + }); + + it('returns element with deployment-badge class when includes_fix is true', () => { + const status = { deployed_commit: 'abc123', fix_commits: [{ hash: 'aabbcc', message: 'fix' }], includes_fix: true }; const el = renderDeploymentBadge(status, makeDoc()); assert.ok(el, 'element should not be null'); assert.ok(el.className.includes('deployment-badge'), `className should include deployment-badge, got: ${el.className}`); @@ -46,26 +52,14 @@ describe('renderDeploymentBadge', () => { assert.ok(el.textContent.includes('Deployed'), `expected "Deployed" in "${el.textContent}"`); }); - it('shows "Not deployed" text when includes_fix is false', () => { - const status = { deployed_commit: 'abc123', fix_commits: [{ hash: 'aabbcc', message: 'fix' }], includes_fix: false }; - const el = renderDeploymentBadge(status, makeDoc()); - assert.ok(el.textContent.includes('Not deployed'), `expected "Not deployed" in "${el.textContent}"`); - }); - it('applies deployed class when includes_fix is true', () => { const status = { deployed_commit: 'abc123', fix_commits: [{ hash: 'aabbcc', message: 'fix' }], includes_fix: true }; const el = renderDeploymentBadge(status, makeDoc()); assert.ok(el.className.includes('deployment-badge--deployed'), `className: ${el.className}`); }); - it('applies pending class when includes_fix is false', () => { - const status = { deployed_commit: 'abc123', fix_commits: [{ hash: 'aabbcc', message: 'fix' }], includes_fix: false }; - const el = renderDeploymentBadge(status, makeDoc()); - assert.ok(el.className.includes('deployment-badge--pending'), `className: ${el.className}`); - }); - it('returns null for doc=null', () => { - const status = { deployed_commit: 'abc', fix_commits: [], includes_fix: false }; + const status = { deployed_commit: 'abc', fix_commits: [], includes_fix: true }; const el = renderDeploymentBadge(status, null); assert.equal(el, null); }); |
