MCPcopy
hub / github.com/tomkp/react-split-pane / createKeyboardEvent

Function createKeyboardEvent

src/hooks/useKeyboardResize.test.ts:12–22  ·  view source on GitHub ↗
(
    key: string,
    options: Partial<React.KeyboardEvent> = {}
  )

Source from the content-addressed store, hash-verified

10
11describe('useKeyboardResize', () => {
12 const createKeyboardEvent = (
13 key: string,
14 options: Partial<React.KeyboardEvent> = {}
15 ): React.KeyboardEvent =>
16 ({
17 key,
18 shiftKey: false,
19 preventDefault: vi.fn(),
20 nativeEvent: new KeyboardEvent('keydown', { key }),
21 ...options,
22 }) as unknown as React.KeyboardEvent;
23
24 beforeEach(() => {
25 vi.clearAllMocks();

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…