Skip to content

test : added unit tests for KeyboardShortcutsModal component - #3

Open
tmdeveloper007 wants to merge 2 commits into
mainfrom
#8418
Open

tmdeveloper007 wants to merge 2 commits into
mainfrom
#8418

Conversation

@tmdeveloper007

Copy link
Copy Markdown
Owner

Summary of What Has Been Done

Created components/KeyboardShortcutsModal.test.tsx with comprehensive unit tests covering:

  • No rendering when isOpen is false
  • Correct rendering when isOpen is true (dialog, heading, shortcut groups)
  • Closes on backdrop click
  • Closes on X (close) button click
  • Closes on Escape key press
  • Body scroll is locked when open and restored when closed
  • Navigation and General shortcut groups render correctly
  • Kbd elements render for shortcut keys
  • Footer hint renders with the ? toggle instruction

Changes Made

  • New file: components/KeyboardShortcutsModal.test.tsx

Impact it Made

Adds first unit test coverage for the KeyboardShortcutsModal component, ensuring correct open/close behavior and accessibility features work correctly.

Closes #8418.

Note: please assign this PR to the tmdeveloper007 account.

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.

1 participant