There was an error while loading. Please reload this page.
mockDragData mocks Foundry’s TextEditor.getDragEventData utility method so that you can test code that uses it.
[documents?: Record<string, foundry.abstract.Document>
The data that you would like the mock to return.
import { afterEach, describe, expect, it, vi } from 'vitest' import { mockDragData } from '@revolutionarygamesco/common-foundryvtt/mocks' describe('getDroppedDocument', () => { afterEach(() => { vi.unstubAllGlobals() }) it('gets the UUID', () => { const uuid = 'Actor.1111111111111111' mockDragData({ uuid }) const data = foundry.applications.ux.TextEditor.getDragEventData(event) as { uuid?: string } expect(data.uuid).toBe(uuid) }) })