2.8 KiB
2.8 KiB
id, title, status, wave, depends_on, plan, spec
| id | title | status | wave | depends_on | plan | spec | |
|---|---|---|---|---|---|---|---|
| 12-e2e-and-mock-agent | Mock-agent review scenario and Playwright E2E | pending | 9 |
|
plan.md | ../../specs/agents/requirements/native-code-review.md |
Task 12: Mock-agent review scenario and Playwright E2E
Hermetic coverage for both trigger paths.
Inputs
- Spec Scenarios — the E2E table in
plan.mdmaps each covered scenario to a file. apps/backend/cmd/mock-agent/AGENTS.md— prompt-marker detection precedent (isChangesWalkthroughRequest), the inlinee2e:mcp:kandev:<tool>({...})directive, and the rebuild before e2e requirement.apps/web/e2e/README.mdfor project layout and helpers.
Work
apps/backend/cmd/mock-agent/handler.go—isCodeReviewRequest(prompt)matching theKANDEV_CODE_REVIEW_REQUESTsentinel, dispatching to a handler that returns a deterministic fenced-JSON payload with: oneblockerfinding, onenitfinding, one entry that is deliberately malformed (to exercise the rejected-count path), and a short summary. Derive the anchored file/line from theAvailable changed files:block in the prompt so the payload anchors to a file the test actually changed.apps/backend/cmd/mock-agent/mock_agent_test.go— assert the dispatch and the payload shape.apps/web/e2e/review/code-review-on-demand.spec.ts— run from the Review surface; assert the run reaches completed, the finding card renders at the expected line, the overview count, resolve-then-reload persistence, send-to-agent reaching the chat, and the no-capable-agent inline message (by disabling thecode-reviewutility agent and clearing the default).apps/web/e2e/review/code-review-workflow-step.spec.ts— configure a step withrun_code_review, move a task with changes into it, assert findings appear and the run reports the workflow-step trigger.apps/web/e2e/mobile/code-review-findings.spec.ts— phone viewport: findings sheet visible, resolve from the sheet, tap-to-navigate.- Add
data-testidattributes to the new components as needed; follow thedata-legacy-testidrule if any existing id is renamed.
Acceptance
- All three specs pass locally against a freshly built mock agent.
- No spec depends on wall-clock sleeps; waits are on observable UI state.
Verification
make -C apps/backend build-mock-agent
cd apps/web && pnpm e2e e2e/review/code-review-on-demand.spec.ts e2e/review/code-review-workflow-step.spec.ts
cd apps/web && pnpm e2e --project=mobile-chrome e2e/mobile/code-review-findings.spec.ts
Files likely touched
apps/backend/cmd/mock-agent/{handler.go,mock_agent_test.go}, apps/web/e2e/review/*.spec.ts, apps/web/e2e/mobile/code-review-findings.spec.ts, new data-testids in the review components.
Output contract
Summary, files changed, tests run with results, blockers, risks, status: done, plan checkbox.