| 10 | } from './dnd' |
| 11 | |
| 12 | function 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 | |
| 28 | describe('drag payload helpers', () => { |
| 29 | it('keeps asset drags distinct from note/folder drags', () => { |