File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -77,3 +77,27 @@ Vue.prototype.t = global.t
7777Vue . prototype . n = global . n
7878Vue . prototype . OC = OC
7979Vue . prototype . OCA = OCA
80+
81+ // Mock ClipboardEvent and DragEvent as long as jsdom is used
82+ // https://github.com/ueberdosis/tiptap/issues/4455
83+ class ClipboardEventMock extends Event {
84+ constructor ( type , eventInitDict ) {
85+ super ( type , eventInitDict ) ;
86+ this . clipboardData = {
87+ getData : jest . fn ( ) ,
88+ setData : jest . fn ( ) ,
89+ } ;
90+ }
91+ }
92+ global . ClipboardEvent = ClipboardEventMock ;
93+
94+ class DragEventMock extends Event {
95+ constructor ( type , eventInitDict ) {
96+ super ( type , eventInitDict ) ;
97+ this . dataTransfer = {
98+ getData : jest . fn ( ) ,
99+ setData : jest . fn ( ) ,
100+ } ;
101+ }
102+ }
103+ global . DragEvent = DragEventMock ;
You can’t perform that action at this time.
0 commit comments