diff --git a/e2e/rich-text-paste.test.ts b/e2e/rich-text-paste.test.ts index 1ba20f5d..1f2aef44 100644 --- a/e2e/rich-text-paste.test.ts +++ b/e2e/rich-text-paste.test.ts @@ -26,8 +26,9 @@ test.describe("Rich text paste", () => { const event = new ClipboardEvent("paste", { bubbles: true, cancelable: true, - clipboardData, }); + // Firefox ignores clipboardData in the constructor, so set it via defineProperty + Object.defineProperty(event, "clipboardData", { value: clipboardData }); document.querySelector("#sb-editor .cm-content")! .dispatchEvent(event); }, @@ -66,8 +67,9 @@ test.describe("Rich text paste", () => { const event = new ClipboardEvent("paste", { bubbles: true, cancelable: true, - clipboardData, }); + // Firefox ignores clipboardData in the constructor, so set it via defineProperty + Object.defineProperty(event, "clipboardData", { value: clipboardData }); document.querySelector("#sb-editor .cm-content")! .dispatchEvent(event); },