From 1b6b27357c817359574605b854f6468917da314d Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Mon, 16 Mar 2026 21:30:36 +0000 Subject: 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 --- web/test/deployment-badge.test.mjs | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) (limited to 'web/test/deployment-badge.test.mjs') 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); }); -- cgit v1.2.3