diff options
| author | Maze Winther <mazewinther@gmail.com> | 2025-08-13 17:05:17 +0200 |
|---|---|---|
| committer | Maze Winther <mazewinther@gmail.com> | 2025-08-13 17:05:17 +0200 |
| commit | 0274fb662647630803598e01c975e6b1439922ab (patch) | |
| tree | 5cb90f172e8c47cb8db6a2d24bd6fed2163ca08a /apps/web/src/hooks | |
| parent | 0ae09c9df5591e2d18991a9f98647826997fe740 (diff) | |
| download | opencut-0274fb662647630803598e01c975e6b1439922ab.tar.gz | |
cleanup
Diffstat (limited to 'apps/web/src/hooks')
| -rw-r--r-- | apps/web/src/hooks/__tests__/use-keyboard-shortcuts-help.test.ts | 46 | ||||
| -rw-r--r-- | apps/web/src/hooks/use-keyboard-shortcuts-help.ts | 2 |
2 files changed, 1 insertions, 47 deletions
diff --git a/apps/web/src/hooks/__tests__/use-keyboard-shortcuts-help.test.ts b/apps/web/src/hooks/__tests__/use-keyboard-shortcuts-help.test.ts deleted file mode 100644 index 52c7dcd6..00000000 --- a/apps/web/src/hooks/__tests__/use-keyboard-shortcuts-help.test.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { describe, it, expect, beforeEach } from 'vitest' -import { renderHook } from '@testing-library/react' -import { useKeyboardShortcutsHelp } from '../use-keyboard-shortcuts-help' -import { useKeybindingsStore } from '../../stores/keybindings-store' - -describe('useKeyboardShortcutsHelp', () => { - beforeEach(() => { - // Reset store to default state before each test - useKeybindingsStore.getState().resetToDefaults() - }) - - it('should format Enter key correctly in shortcuts', () => { - const { result } = renderHook(() => useKeyboardShortcutsHelp()) - - // Find the goto-start action in shortcuts - const gotoStartShortcut = result.current.shortcuts.find( - shortcut => shortcut.action === 'goto-start' - ) - - expect(gotoStartShortcut).toBeDefined() - expect(gotoStartShortcut?.keys).toContain('Enter') - expect(gotoStartShortcut?.keys).toContain('Home') - }) - - it('should include goto-start action with correct description', () => { - const { result } = renderHook(() => useKeyboardShortcutsHelp()) - - const gotoStartShortcut = result.current.shortcuts.find( - shortcut => shortcut.action === 'goto-start' - ) - - expect(gotoStartShortcut).toBeDefined() - expect(gotoStartShortcut?.description).toBe('Go to timeline start') - expect(gotoStartShortcut?.category).toBe('Navigation') - }) - - it('should have multiple keys for goto-start action', () => { - const { result } = renderHook(() => useKeyboardShortcutsHelp()) - - const gotoStartShortcut = result.current.shortcuts.find( - shortcut => shortcut.action === 'goto-start' - ) - - expect(gotoStartShortcut?.keys.length).toBeGreaterThanOrEqual(2) - }) -})
\ No newline at end of file diff --git a/apps/web/src/hooks/use-keyboard-shortcuts-help.ts b/apps/web/src/hooks/use-keyboard-shortcuts-help.ts index 98810cb1..e2cde3b4 100644 --- a/apps/web/src/hooks/use-keyboard-shortcuts-help.ts +++ b/apps/web/src/hooks/use-keyboard-shortcuts-help.ts @@ -77,7 +77,7 @@ const formatKey = (key: string): string => { .replace("down", "↓") .replace("space", "Space") .replace("home", "Home") - .replace("enter", "Enter") // Format Enter key for display in help dialog + .replace("enter", "Enter") .replace("end", "End") .replace("delete", "Delete") .replace("backspace", "Backspace") |
