summaryrefslogtreecommitdiff
path: root/web/test
diff options
context:
space:
mode:
Diffstat (limited to 'web/test')
-rw-r--r--web/test/task-actions.test.mjs14
1 files changed, 9 insertions, 5 deletions
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');
+ });
});