Improve design of the rich text editor (#9533)
New design for rich text composer
This commit is contained in:
parent
9101b42de8
commit
5ca9accce2
31 changed files with 668 additions and 270 deletions
|
@ -31,6 +31,29 @@ class ResizeObserver {
|
|||
}
|
||||
window.ResizeObserver = ResizeObserver;
|
||||
|
||||
// Stub DOMRect
|
||||
class DOMRect {
|
||||
x = 0;
|
||||
y = 0;
|
||||
top = 0;
|
||||
bottom = 0;
|
||||
left = 0;
|
||||
right = 0;
|
||||
height = 0;
|
||||
width = 0;
|
||||
|
||||
static fromRect() {
|
||||
return new DOMRect();
|
||||
}
|
||||
toJSON() {}
|
||||
}
|
||||
|
||||
window.DOMRect = DOMRect;
|
||||
|
||||
// Work around missing ClipboardEvent type
|
||||
class MyClipboardEvent {}
|
||||
window.ClipboardEvent = MyClipboardEvent as any;
|
||||
|
||||
// matchMedia is not included in jsdom
|
||||
const mockMatchMedia = jest.fn().mockImplementation(query => ({
|
||||
matches: false,
|
||||
|
@ -51,6 +74,7 @@ global.URL.revokeObjectURL = jest.fn();
|
|||
// polyfilling TextEncoder as it is not available on JSDOM
|
||||
// view https://github.com/facebook/jest/issues/9983
|
||||
global.TextEncoder = TextEncoder;
|
||||
// @ts-ignore
|
||||
global.TextDecoder = TextDecoder;
|
||||
|
||||
// prevent errors whenever a component tries to manually scroll.
|
||||
|
@ -60,4 +84,5 @@ window.HTMLElement.prototype.scrollIntoView = jest.fn();
|
|||
fetchMock.config.overwriteRoutes = false;
|
||||
fetchMock.catch("");
|
||||
fetchMock.get("/image-file-stub", "image file stub");
|
||||
// @ts-ignore
|
||||
window.fetch = fetchMock.sandbox();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue