Skip to content

test(cli): add unit tests for dashboard projects CLI commands#940

Merged
aaight merged 1 commit intodevfrom
feature/unit-tests-dashboard-projects-cli
Mar 17, 2026
Merged

test(cli): add unit tests for dashboard projects CLI commands#940
aaight merged 1 commit intodevfrom
feature/unit-tests-dashboard-projects-cli

Conversation

@aaight
Copy link
Copy Markdown
Collaborator

@aaight aaight commented Mar 17, 2026

Summary

Commands tested

  • list — calls client.projects.listFull.query, handles table/JSON output and empty list
  • show — passes project ID to getById.query, renders detail view and JSON output
  • create — passes --id, --name, --repo required flags + optional flags (base-branch, agent-engine, max-iterations) to create.mutate
  • update — tests flag combinations: model, max-iterations, agent-engine, boolean run-links-enabled (+ --no-run-links-enabled), numeric flags (work-item-budget, watchdog-timeout, max-in-flight-items), progress-model, progress-interval, and verifies runLinksEnabled is absent when flag not provided
  • delete — passes project ID with --yes flag and calls delete.mutate; verifies non-TTY auto-accept
  • integrations — passes project ID, lists integrations, handles empty list and JSON output
  • integration-set — passes category/provider/config JSON; handles optional triggers JSON; validates invalid JSON errors
  • trigger-discover — passes agent type, lists triggers in table and JSON mode; handles no-triggers case and unknown agent type
  • trigger-list — passes project ID; tests optional --agent filter routing to correct query endpoint
  • trigger-set — handles --enable/--disable flags, --params JSON parsing, params-only updates, missing option error, invalid event format, and invalid JSON params

Test plan

  • npx vitest run --project unit-core tests/unit/cli/dashboard/projects/ — 52 tests pass (44 new + 8 existing)
  • npm run lint — no issues
  • npm run typecheck — no errors

🤖 Generated with Claude Code

🕵️ claude-code · claude-sonnet-4-6 · run details

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Collaborator

@nhopeatall nhopeatall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — well-structured unit tests that closely follow the established mock pattern from integration-credentials.test.ts. All 44 new test assertions accurately reflect the actual CLI command implementations (verified by reading all 10 source files). Good coverage of happy paths, flag combinations, error cases (missing required args, invalid JSON), and edge cases (absent optional flags like runLinksEnabled, non-TTY auto-accept for delete). CI is green.

🕵️ claude-code · claude-opus-4-6 · run details

@aaight aaight merged commit 060e94d into dev Mar 17, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants