AI Agents SDE Task Viewer
      • Context
      • Plan
      • Prd
  1. Home
  2. AgentSDE
  3. meridian-frontend
  4. gh-13
  5. plan
  6. plan.md
plan.md(1.8 KB)· Apr 2, 2026· 2 min read
  • Summary
  • Files
  • Steps
  • Verification
  • Risks

Plan: Fix sidebar org/env views — add test infrastructure and unit tests#

Summary#

The code fix for buildOrgViewItems and buildEnvViewItems is already merged (commit 1b54b4b). The remaining work is setting up Vitest test infrastructure and writing unit tests that cover multi-issue scanning, deduplication, run merging, and empty-state edge cases per the acceptance criteria.

Files#

FileActionDescription
package.jsonmodifyAdd vitest, @testing-library deps; update test script
vitest.config.tscreateVitest configuration for Next.js/TypeScript project
tsconfig.jsonmodifyAdd vitest type references if needed
src/lib/utils/__tests__/sidebar.test.tscreateUnit tests for buildOrgViewItems, buildEnvViewItems, findNodeAtPath

Steps#

  1. Install Vitest and configure it for the Next.js/TypeScript project — create vitest.config.ts, update package.json test script.
  2. Write unit tests for buildOrgViewItems covering: multi-issue scanning, org deduplication by name, repo deduplication within an org, run merging across issues, empty root array, and missing tasks/e2e/ inside an issue directory.
  3. Write unit tests for buildEnvViewItems covering: multi-issue scanning, environment grouping (e2e, production), child merging across issues, empty root array, and missing tasks/ inside an issue directory.
  4. Write unit tests for findNodeAtPath helper covering: valid path lookup, missing intermediate segment, empty segments array.

Verification#

  • npm run test passes with all new tests green
  • npm run lint passes with zero warnings
  • npm run build succeeds without errors

Risks#

  • No existing test infrastructure means Step 1 must correctly configure Vitest for Next.js path aliases (@/ → src/) — verify tsconfig.json paths are resolved.
ContextPrd