From 7db2ee749ff84c43cd0abe46ca0daa52a2a19e68 Mon Sep 17 00:00:00 2001 From: Florian Duros Date: Wed, 21 Dec 2022 12:22:17 +0100 Subject: [PATCH] Fix rte flaky test (#9811) --- .../rooms/wysiwyg_composer/EditWysiwygComposer-test.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/components/views/rooms/wysiwyg_composer/EditWysiwygComposer-test.tsx b/test/components/views/rooms/wysiwyg_composer/EditWysiwygComposer-test.tsx index c0849145bf..b442640ce6 100644 --- a/test/components/views/rooms/wysiwyg_composer/EditWysiwygComposer-test.tsx +++ b/test/components/views/rooms/wysiwyg_composer/EditWysiwygComposer-test.tsx @@ -64,12 +64,15 @@ describe("EditWysiwygComposer", () => { ); }; + beforeAll(() => { + // Load the dynamic import + customRender(false).unmount(); + }); + it("Should not render the component when not ready", async () => { // When const { rerender } = customRender(false); - await waitFor(() => expect(screen.getByRole("textbox")).toHaveAttribute("contentEditable", "true"), { - timeout: 2000, - }); + await waitFor(() => expect(screen.getByRole("textbox")).toHaveAttribute("contentEditable", "true")); rerender(