diff options
| author | Claudomator Agent <agent@claudomator> | 2026-03-13 04:03:33 +0000 |
|---|---|---|
| committer | Claudomator Agent <agent@claudomator> | 2026-03-13 04:03:33 +0000 |
| commit | cd99fec867ee86671148a954b2c18d2cb9f6b946 (patch) | |
| tree | 918213ff28aea478f88ca3c4770d1436eb6b7b13 /web/test/new-task-button.test.mjs | |
| parent | fe414fac958330c2302d9175d66e1b338e5b1864 (diff) | |
feat: show New Task button on all tabs
Removed the switchTab() logic that hid btn-new-task on non-tasks tabs.
The button lives in the global header so no structural changes were needed.
Added new-task-button.test.mjs to contract-test the always-visible behavior.
Diffstat (limited to 'web/test/new-task-button.test.mjs')
| -rw-r--r-- | web/test/new-task-button.test.mjs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/web/test/new-task-button.test.mjs b/web/test/new-task-button.test.mjs new file mode 100644 index 0000000..45a3548 --- /dev/null +++ b/web/test/new-task-button.test.mjs @@ -0,0 +1,24 @@ +// new-task-button.test.mjs — visibility contract for the New Task button +// +// The New Task button lives in the global header and must be visible on all tabs. +// Run with: node --test web/test/new-task-button.test.mjs + +import { describe, it } from 'node:test'; +import assert from 'node:assert/strict'; +import { newTaskButtonShouldShowOnTab } from '../app.js'; + +const ALL_TABS = ['tasks', 'active', 'running', 'stats']; + +describe('new task button visibility', () => { + for (const tab of ALL_TABS) { + it(`is visible on "${tab}" tab`, () => { + assert.equal(newTaskButtonShouldShowOnTab(tab), true, `expected button to be visible on tab "${tab}"`); + }); + } + + it('is visible on any unknown future tab', () => { + assert.equal(newTaskButtonShouldShowOnTab('help'), true); + assert.equal(newTaskButtonShouldShowOnTab('templates'), true); + assert.equal(newTaskButtonShouldShowOnTab(''), true); + }); +}); |
