test(quick-261022-k9k): keyboard shortcut coverage

- hotkey core: combos, AltGr and layouts, labels, aria-keyshortcuts, editable
  targets, modal root, refcounted install, disabled and repeat
- smoke: record, create, Create and new (new session key), Esc, modal scope,
  settings Save and close, My account, list search and the help dialog
- ShortcutHelpDialog rows, keys and close button
This commit is contained in:
Jakub Zych
2026-10-22 21:07:40 +02:00
parent 66bb96eebd
commit 058738efdf
4 changed files with 760 additions and 12 deletions

View File

@@ -117,6 +117,13 @@ export function keydown(target: Element, key: string): KeyboardEvent {
return event
}
/** Dispatches a bubbling, cancelable keydown with extra init (modifiers, code, repeat) and returns the event. */
export function press(target: Element, key: string, init: KeyboardEventInit = {}): KeyboardEvent {
const event = new KeyboardEvent('keydown', { key, bubbles: true, cancelable: true, ...init })
target.dispatchEvent(event)
return event
}
export const wait = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms))
type MediaListener = (event: MediaQueryListEvent) => void