mirror of
https://github.com/zadam/trilium.git
synced 2025-11-08 06:15:48 +01:00
test(hotkeys): add some basic tests
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user