Skip to content

test: add unit tests for keyboard shortcut hook confirming it does not fire when focus is in a form element (#626) - #712

Merged
Chucks1093 merged 1 commit into
accesslayerorg:devfrom
abimbolaalabi:fix/issue-626-keyboard-shortcut-form-tests
Jul 28, 2026
Merged

test: add unit tests for keyboard shortcut hook confirming it does not fire when focus is in a form element (#626)#712
Chucks1093 merged 1 commit into
accesslayerorg:devfrom
abimbolaalabi:fix/issue-626-keyboard-shortcut-form-tests

Conversation

@abimbolaalabi

Copy link
Copy Markdown

Overview

This PR adds unit tests for the \T\ keyboard shortcut hook in \LandingPage, confirming the handler correctly fires when focus is on the document body and is suppressed when focus is on form elements (\input, \ extarea, \select).

Related Issue

Closes #626

Changes

Keyboard Shortcut Tests

  • [ADD] \src/pages/tests/LandingPage.tradeShortcut.test.tsx\
    • Simulates \T\ keydown with focus on \document.body\ and asserts the handler fires (dialog opens)
    • Simulates \T\ keydown with focus on <input>\ and asserts the handler does not fire
    • Simulates \T\ keydown with focus on <textarea>\ and asserts the handler does not fire
    • Simulates \T\ keydown with focus on <select>\ and asserts the handler does not fire

Verification Results

\
pnpm vitest run src/pages/tests/LandingPage.tradeShortcut.test.tsx
✅ 4/4 passed
\\

Acceptance Criteria Status
Handler fires when focus is on the document body ✅ Passed
Handler suppressed when focus is on an input ✅ Passed
Handler suppressed when focus is on a textarea ✅ Passed
Handler suppressed when focus is on a select ✅ Passed

@drips-wave

drips-wave Bot commented Jul 28, 2026

Copy link
Copy Markdown

@abimbolaalabi Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Chucks1093
Chucks1093 merged commit 0c49407 into accesslayerorg:dev Jul 28, 2026
7 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 unit tests for the keyboard shortcut hook confirming it does not fire when focus is in a form element

2 participants