From 13846ea4ce4bacfadda6f86c5e48e5e76e13db07 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Mon, 9 Mar 2026 01:17:05 +0000 Subject: feat: delete templates feature and allow requeueing BUDGET_EXCEEDED tasks Removed all template-related code from frontend (tabs, modals, logic) and backend (routes, files, DB table). Updated BUDGET_EXCEEDED tasks to be requeueable with a Restart button. Fixed ReferenceError in isUserEditing for Node.js tests. --- web/test/task-actions.test.mjs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'web/test/task-actions.test.mjs') diff --git a/web/test/task-actions.test.mjs b/web/test/task-actions.test.mjs index 36c0e8b..c7d666b 100644 --- a/web/test/task-actions.test.mjs +++ b/web/test/task-actions.test.mjs @@ -7,7 +7,7 @@ import assert from 'node:assert/strict'; // ── Logic under test ────────────────────────────────────────────────────────── -const RESTART_STATES = new Set(['FAILED', 'CANCELLED']); +const RESTART_STATES = new Set(['FAILED', 'CANCELLED', 'BUDGET_EXCEEDED']); function getCardAction(state) { if (state === 'PENDING') return 'run'; @@ -47,6 +47,10 @@ describe('task card action buttons', () => { assert.equal(getCardAction('CANCELLED'), 'restart'); }); + it('shows Restart button for BUDGET_EXCEEDED', () => { + assert.equal(getCardAction('BUDGET_EXCEEDED'), 'restart'); + }); + it('shows approve buttons for READY', () => { assert.equal(getCardAction('READY'), 'approve'); }); @@ -58,10 +62,6 @@ describe('task card action buttons', () => { it('shows no button for QUEUED', () => { assert.equal(getCardAction('QUEUED'), null); }); - - it('shows no button for BUDGET_EXCEEDED', () => { - assert.equal(getCardAction('BUDGET_EXCEEDED'), null); - }); }); describe('task action API endpoints', () => { @@ -76,4 +76,8 @@ describe('task action API endpoints', () => { it('CANCELLED uses /run endpoint', () => { assert.equal(getApiEndpoint('CANCELLED'), '/run'); }); + + it('BUDGET_EXCEEDED uses /run endpoint', () => { + assert.equal(getApiEndpoint('BUDGET_EXCEEDED'), '/run'); + }); }); -- cgit v1.2.3