You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-08-07 21:23:00 +03:00
Apply prettier formatting
This commit is contained in:
@@ -19,29 +19,31 @@ import { ReactWrapper } from "enzyme";
|
||||
import { act } from "react-dom/test-utils";
|
||||
import { fireEvent } from "@testing-library/react";
|
||||
|
||||
export const addTextToComposer = (container: HTMLElement, text: string) => act(() => {
|
||||
// couldn't get input event on contenteditable to work
|
||||
// paste works without illegal private method access
|
||||
const pasteEvent = {
|
||||
clipboardData: {
|
||||
types: [],
|
||||
files: [],
|
||||
getData: type => type === "text/plain" ? text : undefined,
|
||||
},
|
||||
};
|
||||
fireEvent.paste(container.querySelector('[role="textbox"]'), pasteEvent);
|
||||
});
|
||||
export const addTextToComposer = (container: HTMLElement, text: string) =>
|
||||
act(() => {
|
||||
// couldn't get input event on contenteditable to work
|
||||
// paste works without illegal private method access
|
||||
const pasteEvent = {
|
||||
clipboardData: {
|
||||
types: [],
|
||||
files: [],
|
||||
getData: (type) => (type === "text/plain" ? text : undefined),
|
||||
},
|
||||
};
|
||||
fireEvent.paste(container.querySelector('[role="textbox"]'), pasteEvent);
|
||||
});
|
||||
|
||||
export const addTextToComposerEnzyme = (wrapper: ReactWrapper, text: string) => act(() => {
|
||||
// couldn't get input event on contenteditable to work
|
||||
// paste works without illegal private method access
|
||||
const pasteEvent = {
|
||||
clipboardData: {
|
||||
types: [],
|
||||
files: [],
|
||||
getData: type => type === "text/plain" ? text : undefined,
|
||||
},
|
||||
};
|
||||
wrapper.find('[role="textbox"]').simulate('paste', pasteEvent);
|
||||
wrapper.update();
|
||||
});
|
||||
export const addTextToComposerEnzyme = (wrapper: ReactWrapper, text: string) =>
|
||||
act(() => {
|
||||
// couldn't get input event on contenteditable to work
|
||||
// paste works without illegal private method access
|
||||
const pasteEvent = {
|
||||
clipboardData: {
|
||||
types: [],
|
||||
files: [],
|
||||
getData: (type) => (type === "text/plain" ? text : undefined),
|
||||
},
|
||||
};
|
||||
wrapper.find('[role="textbox"]').simulate("paste", pasteEvent);
|
||||
wrapper.update();
|
||||
});
|
||||
|
Reference in New Issue
Block a user