From 09b2db534ff306c8f202572485033b3c358fe4d8 Mon Sep 17 00:00:00 2001 From: Dariusz Niemczyk Date: Fri, 1 Oct 2021 13:40:36 +0200 Subject: [PATCH] Typescriptify test --- ...r-test.js => SendMessageComposer-test.tsx} | 53 +++++++++++-------- 1 file changed, 31 insertions(+), 22 deletions(-) rename test/components/views/rooms/{SendMessageComposer-test.js => SendMessageComposer-test.tsx} (88%) diff --git a/test/components/views/rooms/SendMessageComposer-test.js b/test/components/views/rooms/SendMessageComposer-test.tsx similarity index 88% rename from test/components/views/rooms/SendMessageComposer-test.js rename to test/components/views/rooms/SendMessageComposer-test.tsx index db5b55df9034..1c287bd9cbb1 100644 --- a/test/components/views/rooms/SendMessageComposer-test.js +++ b/test/components/views/rooms/SendMessageComposer-test.tsx @@ -26,6 +26,7 @@ import SendMessageComposer, { isQuickReaction, } from "../../../../src/components/views/rooms/SendMessageComposer"; import MatrixClientContext from "../../../../src/contexts/MatrixClientContext"; +import RoomContext from "../../../../src/contexts/RoomContext"; import EditorModel from "../../../../src/editor/model"; import { createPartCreator, createRenderer } from "../../../editor/mock"; import { createTestClient, mkEvent, mkStubRoom } from "../../../test-utils"; @@ -116,11 +117,13 @@ describe('', () => { it("renders text and placeholder correctly", () => { const wrapper = mount( - + + + ); expect(wrapper.find('[aria-label="placeholder string"]')).toHaveLength(1); @@ -135,12 +138,14 @@ describe('', () => { it("correctly persists state to and from localStorage", () => { const wrapper = mount( - + + + ); act(() => { @@ -177,11 +182,13 @@ describe('', () => { it("persists state correctly without replyToEvent onbeforeunload", () => { const wrapper = mount( - + + + ); act(() => { @@ -203,12 +210,14 @@ describe('', () => { it("persists to session history upon sending", async () => { const wrapper = mount( - + + + ); act(() => {