test(dashboard): browser smoke tests for agents CRUD UI #117

Closed
opened 2026-04-20 00:52:51 +00:00 by dev · 1 comment
Collaborator

Context

PR #116 (A6 agents CRUD) added 4 structural HTML smoke tests in src/dashboard-smoke.test.ts that verify the Agents tab, create modal, and delete-confirm modal are present in the served HTML.

Full runtime smoke tests (form submission, modal toggling, list renders from SSE) require a browser environment. The project currently has no Playwright or JSDOM infrastructure.

Acceptance criteria

  • Set up Playwright or JSDOM (e.g. happy-dom via Bun) in the project
  • Add smoke tests covering:
    • Agents list renders after loadAgents() resolves
    • Clicking + New agent opens the create modal
    • Submitting the create form triggers POST /agents
    • Clicking delete triggers the confirm modal
    • Typing the wrong name keeps the Delete button disabled
## Context PR #116 (A6 agents CRUD) added 4 structural HTML smoke tests in `src/dashboard-smoke.test.ts` that verify the Agents tab, create modal, and delete-confirm modal are present in the served HTML. Full runtime smoke tests (form submission, modal toggling, list renders from SSE) require a browser environment. The project currently has no Playwright or JSDOM infrastructure. ## Acceptance criteria - Set up Playwright or JSDOM (e.g. `happy-dom` via Bun) in the project - Add smoke tests covering: - Agents list renders after `loadAgents()` resolves - Clicking `+ New agent` opens the create modal - Submitting the create form triggers `POST /agents` - Clicking delete triggers the confirm modal - Typing the wrong name keeps the Delete button disabled
Collaborator

⚠️ Guardrails for this dispatch

Prior attempt (task af076472, 2026-04-20) died mid-pivot between happy-dom → jsdom with exit 137 — the dev agent's container silently disappeared during a bun install. Unclear root cause; not reproducible yet. Operator recreated the container and is re-dispatching.

To reduce the risk of a second runaway:

Scope your test runs

  • Do not run bun test at repo root during exploration. The 400+ existing tests include some that exercise SQLite + container-reconcile paths, and iterating those while you're also installing new deps is a heavy combo that's already caused one bun-install timeout / kill. Scope every test invocation to your new file only: bun test src/<name>.test.ts.
  • Only run the full bun test + just qa suite once, at the end, right before committing.

Pick the library quickly

  • happy-dom has a known <select> bug per the prior run. Either:
    • Use jsdom (more mature, standard choice for Node/Bun DOM smoke tests), or
    • Work around the <select> issue in the test (e.g. synthesize a change event directly instead of letting happy-dom's select logic handle it).
  • Don't iterate: pick one, write all 5 AC tests, commit. If jsdom doesn't install cleanly in one try (bun add -d jsdom), switch to happy-dom + the workaround rather than thrashing between them.

Keep installs minimal

  • Only add one DOM library as a devDependencies dep. Don't install Playwright — AC doesn't require it, and its Chromium bundle is ~200 MB.
  • Don't bun install --production=false globally or refresh the lockfile for unrelated deps.

If you hit an environment issue

  • Surface it in a PR draft with the diagnostic rather than iterating blindly. An exit code from a child process you don't understand is a signal to stop and report, not to try a third library.

Scope of acceptance

The AC (5 smoke tests in src/dashboard-smoke.test.ts or a new file) is intentionally small. Expected diff: ~1 new test file, ~1 line in package.json for the DOM dep, ~1 line in bun.lock. Anything substantially beyond that is scope creep.

## ⚠️ Guardrails for this dispatch Prior attempt (task `af076472`, 2026-04-20) died mid-pivot between happy-dom → jsdom with exit 137 — the dev agent's container silently disappeared during a `bun install`. Unclear root cause; not reproducible yet. Operator recreated the container and is re-dispatching. To reduce the risk of a second runaway: ### Scope your test runs - **Do not run `bun test` at repo root** during exploration. The 400+ existing tests include some that exercise SQLite + container-reconcile paths, and iterating those while you're also installing new deps is a heavy combo that's already caused one bun-install timeout / kill. Scope every test invocation to **your new file only**: `bun test src/<name>.test.ts`. - Only run the full `bun test` + `just qa` suite **once**, at the end, right before committing. ### Pick the library quickly - `happy-dom` has a known `<select>` bug per the prior run. Either: - Use `jsdom` (more mature, standard choice for Node/Bun DOM smoke tests), or - Work around the `<select>` issue in the test (e.g. synthesize a `change` event directly instead of letting happy-dom's select logic handle it). - Don't iterate: pick one, write all 5 AC tests, commit. If jsdom doesn't install cleanly in one try (`bun add -d jsdom`), switch to happy-dom + the workaround rather than thrashing between them. ### Keep installs minimal - Only add **one** DOM library as a `devDependencies` dep. Don't install Playwright — AC doesn't require it, and its Chromium bundle is ~200 MB. - Don't `bun install --production=false` globally or refresh the lockfile for unrelated deps. ### If you hit an environment issue - Surface it in a PR draft with the diagnostic rather than iterating blindly. An exit code from a child process you don't understand is a signal to stop and report, not to try a third library. ### Scope of acceptance The AC (5 smoke tests in `src/dashboard-smoke.test.ts` or a new file) is intentionally small. Expected diff: ~1 new test file, ~1 line in `package.json` for the DOM dep, ~1 line in `bun.lock`. Anything substantially beyond that is scope creep.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/claude-hooks#117
No description provided.