MCPcopy Create free account
hub / github.com/coder/ghostty-web / createClipboardEvent

Function createClipboardEvent

lib/input-handler.test.ts:61–81  ·  view source on GitHub ↗
(text: string | null)

Source from the content-addressed store, hash-verified

59
60// Helper to create mock clipboard event
61function createClipboardEvent(text: string | null): MockClipboardEvent {
62 const data = new Map<string, string>();
63 if (text !== null) {
64 data.set('text/plain', text);
65 }
66
67 return {
68 type: 'paste',
69 clipboardData:
70 text !== null
71 ? {
72 getData: (format: string) => data.get(format) || '',
73 setData: (format: string, value: string) => {
74 data.set(format, value);
75 },
76 }
77 : null,
78 preventDefault: mock(() => {}),
79 stopPropagation: mock(() => {}),
80 };
81}
82interface MockCompositionEvent {
83 type: string;
84 data: string | null;

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…