1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-13 23:48:55 +01:00
fab-manager/test/frontend/__setup__/rects.js
2022-12-21 14:14:26 +01:00

17 lines
353 B
JavaScript

// the following workarounds are necessary to test with tiptap editor
Range.prototype.getBoundingClientRect = () => ({
bottom: 0,
height: 0,
left: 0,
right: 0,
top: 0,
width: 0
});
Range.prototype.getClientRects = () => ({
item: () => null,
length: 0,
[Symbol.iterator]: jest.fn()
});
Document.prototype.elementFromPoint = jest.fn();