test(hotkeys): add some basic tests

This commit is contained in:
Elian Doran
2025-07-30 19:30:27 +03:00
parent 5289d41b12
commit d5866a99ec
2 changed files with 325 additions and 2 deletions

View File

@@ -81,7 +81,7 @@ function removeNamespaceBindings(namespace: string) {
}
}
function matchesShortcut(e: KeyboardEvent, shortcut: string): boolean {
export function matchesShortcut(e: KeyboardEvent, shortcut: string): boolean {
if (!shortcut) return false;
// Ensure we have a proper KeyboardEvent with key property
@@ -117,7 +117,7 @@ function matchesShortcut(e: KeyboardEvent, shortcut: string): boolean {
e.metaKey === expectedMeta;
}
function keyMatches(e: KeyboardEvent, key: string): boolean {
export function keyMatches(e: KeyboardEvent, key: string): boolean {
// Defensive check for undefined/null key
if (!key) {
console.warn('keyMatches called with undefined/null key');