Load RTE component only when needed (#9804)
Use react lazy to load rte component
This commit is contained in:
parent
26a01aba00
commit
d6e447b934
6 changed files with 92 additions and 28 deletions
|
@ -24,7 +24,7 @@ import defaultDispatcher from "../../../../../src/dispatcher/dispatcher";
|
|||
import { Action } from "../../../../../src/dispatcher/actions";
|
||||
import { IRoomState } from "../../../../../src/components/structures/RoomView";
|
||||
import { createTestClient, flushPromises, getRoomContext, mkEvent, mkStubRoom } from "../../../../test-utils";
|
||||
import { SendWysiwygComposer } from "../../../../../src/components/views/rooms/wysiwyg_composer";
|
||||
import { SendWysiwygComposer } from "../../../../../src/components/views/rooms/wysiwyg_composer/";
|
||||
import { aboveLeftOf } from "../../../../../src/components/structures/ContextMenu";
|
||||
import { ComposerInsertPayload, ComposerType } from "../../../../../src/dispatcher/payloads/ComposerInsertPayload";
|
||||
import { setSelection } from "../../../../../src/components/views/rooms/wysiwyg_composer/utils/selection";
|
||||
|
@ -101,12 +101,12 @@ describe("SendWysiwygComposer", () => {
|
|||
);
|
||||
};
|
||||
|
||||
it("Should render WysiwygComposer when isRichTextEnabled is at true", () => {
|
||||
it("Should render WysiwygComposer when isRichTextEnabled is at true", async () => {
|
||||
// When
|
||||
customRender(jest.fn(), jest.fn(), false, true);
|
||||
|
||||
// Then
|
||||
expect(screen.getByTestId("WysiwygComposer")).toBeTruthy();
|
||||
await waitFor(() => expect(screen.getByTestId("WysiwygComposer")).toBeTruthy());
|
||||
});
|
||||
|
||||
it("Should render PlainTextComposer when isRichTextEnabled is at false", () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue