MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / fakeDragEvent

Function fakeDragEvent

packages/app-core/src/lib/dnd.test.ts:12–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10} from './dnd'
11
12function fakeDragEvent(): DragEvent {
13 const data = new Map<string, string>()
14 const dataTransfer = {
15 types: [] as string[],
16 effectAllowed: 'none',
17 setData(type: string, value: string) {
18 data.set(type, value)
19 if (!this.types.includes(type)) this.types.push(type)
20 },
21 getData(type: string) {
22 return data.get(type) ?? ''
23 }
24 }
25 return { dataTransfer } as unknown as DragEvent
26}
27
28describe('drag payload helpers', () => {
29 it('keeps asset drags distinct from note/folder drags', () => {

Callers 1

dnd.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected