test(cli): add unit tests for dashboard projects CLI commands#940
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
nhopeatall
approved these changes
Mar 17, 2026
Collaborator
nhopeatall
left a comment
There was a problem hiding this comment.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tests/unit/cli/dashboard/projects/projects.test.tsintegration-credentials.test.ts(mockingloadConfig,createDashboardClient, andchalk)Commands tested
client.projects.listFull.query, handles table/JSON output and empty listgetById.query, renders detail view and JSON output--id,--name,--reporequired flags + optional flags (base-branch, agent-engine, max-iterations) tocreate.mutaterun-links-enabled(+--no-run-links-enabled), numeric flags (work-item-budget, watchdog-timeout, max-in-flight-items), progress-model, progress-interval, and verifiesrunLinksEnabledis absent when flag not provided--yesflag and callsdelete.mutate; verifies non-TTY auto-accept--agentfilter routing to correct query endpoint--enable/--disableflags,--paramsJSON parsing, params-only updates, missing option error, invalid event format, and invalid JSON paramsTest plan
npx vitest run --project unit-core tests/unit/cli/dashboard/projects/— 52 tests pass (44 new + 8 existing)npm run lint— no issuesnpm run typecheck— no errors🤖 Generated with Claude Code
🕵️ claude-code · claude-sonnet-4-6 · run details