Skip to content

Add a unit test for the useCommandPalette open/close and shortcut handling#1112

Merged
1nonlypiece merged 1 commit into
Commitlabs-Org:masterfrom
Baskarayelu:issue-982
Jun 29, 2026
Merged

Add a unit test for the useCommandPalette open/close and shortcut handling#1112
1nonlypiece merged 1 commit into
Commitlabs-Org:masterfrom
Baskarayelu:issue-982

Conversation

@Baskarayelu

Copy link
Copy Markdown
Contributor

Closes #982

Summary

  • Add src/hooks/__tests__/useCommandPalette.test.ts with 6 focused test cases
  • Covers open/close via programmatic API (open(), close())
  • Asserts Cmd+K (metaKey) and Ctrl+K (ctrlKey) both toggle the palette
  • Asserts plain K key (no modifier) does not open the palette
  • Verifies the keydown listener is registered and removed on unmount
  • Validates repeated toggle correctness across multiple key presses

Test plan

  • Run pnpm test — all useCommandPalette tests pass
  • Run pnpm lint — no lint errors introduced
  • No regressions in existing test suites

🤖 Generated with Claude Code

@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown

@Baskarayelu is attempting to deploy a commit to the 1nonly's projects Team on Vercel.

A member of the Team first needs to authorize it.

@1nonlypiece 1nonlypiece merged commit d68cc0e into Commitlabs-Org:master Jun 29, 2026
2 of 12 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.

Add a unit test for the useCommandPalette open/close and shortcut handling

2 participants