MCPcopy Create free account
hub / github.com/angular/components / keydown

Function keydown

src/aria/toolbar/toolbar.spec.ts:14–24  ·  view source on GitHub ↗
(key: string, target?: HTMLElement, modifierKeys: {} = {})

Source from the content-addressed store, hash-verified

12 let toolbarElement: HTMLElement;
13
14 const keydown = async (key: string, target?: HTMLElement, modifierKeys: {} = {}) => {
15 const eventTarget = target || toolbarElement;
16 eventTarget.dispatchEvent(
17 new KeyboardEvent('keydown', {
18 key,
19 bubbles: true,
20 ...modifierKeys,
21 }),
22 );
23 await fixture.whenStable();
24 };
25
26 const click = async (element: HTMLElement, eventInit?: PointerEventInit) => {
27 element.dispatchEvent(

Callers 7

rightFunction · 0.70
leftFunction · 0.70
upFunction · 0.70
downFunction · 0.70
homeFunction · 0.70
endFunction · 0.70
toolbar.spec.tsFile · 0.70

Calls 1

dispatchEventMethod · 0.65

Tested by

no test coverage detected