Skip to content

test(wallet): cover keyboard navigation - #1088

Open
khaylebfortune wants to merge 4 commits into
Talenttrust:mainfrom
khaylebfortune:test/wallet-71-keynav
Open

test(wallet): cover keyboard navigation#1088
khaylebfortune wants to merge 4 commits into
Talenttrust:mainfrom
khaylebfortune:test/wallet-71-keynav

Conversation

@khaylebfortune

@khaylebfortune khaylebfortune commented Jul 31, 2026

Copy link
Copy Markdown

closes #1019

Summary

Adds comprehensive keyboard navigation tests for wallet components, covering tab order, arrow keys, Enter, and Escape behavior.

Changes

Bug Fix

  • WalletItemList.tsx — Added missing useCallback import (production defect causing ReferenceError at runtime).

New Test Files (61 tests, 0 failures)

  • EditableWalletRowKeyboard.test.tsx (23) — Tab order in edit mode, Escape to cancel, Enter key behavior, auto-focus, validation error focus, focus ring styles, view mode keyboard access
  • WalletBulkToolbarKeyboard.test.tsx (21) — Arrow key navigation (Right/Down/Left/Up wrapping), Home/End, Escape to clear, auto-focus, tab order, Enter/Space activation
  • WalletPageKeyboardNavigation.test.tsx (17) — Full page tab order, toolbar keyboard flow, dialog keyboard, shortcuts, copy-address button keyboard activation

Edge Cases Covered

  • Tab order: Full Tab/Shift+Tab through edit mode inputs, toolbar buttons, page-level rows
  • Arrow keys: ArrowRight/Down/Left/Up with wrapping, Home/End for first/last focusable
  • Enter: Button activation (Save/Cancel/Delete/Export), suppression on text inputs
  • Escape: Cancel editing, clear selection, close delete dialog
  • Disabled elements: Checkbox skipped during edit mode
  • Auto-focus: Name input on edit entry, toolbar on selection transition

Test Output

PASS EditableWalletRowKeyboard.test.tsx
PASS WalletBulkToolbarKeyboard.test.tsx
PASS WalletPageKeyboardNavigation.test.tsx

Test Suites: 3 passed, 3 total
Tests:       61 passed, 61 total

Lint

0 errors, 0 warnings on all changed files

Notes

  • Deterministic; no real timers (auto-focus via waitFor polling).
  • No behavior changes except useCallback import fix.
  • Pre-existing failures in page.test.tsx (edit-item-btn missing in inline rows) are unrelated.

- contracts/__tests__/page.test.tsx: add missing act import
- milestones/page.tsx: fix duplicate listMilestones import and broken useCallback dep
- ReputationProfile.tsx: define clearSelection callback, import KbdHint
- MilestoneCreationForm.tsx: remove unused useFormValidation, fix undefined validateAndSubmit/hasSubmitted/hasErrors references
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 tests for wallet keyboard navigation

1 participant