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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user