Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 3b11e0f

Browse files
author
Alun Turner
committed
add new test
1 parent 2324a21 commit 3b11e0f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/components/views/rooms/wysiwyg_composer/components/WysiwygComposer-test.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ limitations under the License.
1717
import "@testing-library/jest-dom";
1818
import React from "react";
1919
import { fireEvent, render, screen, waitFor } from "@testing-library/react";
20+
import userEvent from "@testing-library/user-event";
2021

2122
import { WysiwygComposer } from "../../../../../../src/components/views/rooms/wysiwyg_composer/components/WysiwygComposer";
2223
import SettingsStore from "../../../../../../src/settings/SettingsStore";
@@ -87,6 +88,14 @@ describe("WysiwygComposer", () => {
8788
// Then it sends a message
8889
await waitFor(() => expect(onSend).toBeCalledTimes(1));
8990
});
91+
92+
it("Should not call onSend when shift + Enter is pressed ", async () => {
93+
//When
94+
userEvent.type(screen.getByRole("textbox"), "{Shift>}{Enter}");
95+
96+
// Then it does not send a message
97+
await waitFor(() => expect(onSend).toBeCalledTimes(0));
98+
});
9099
});
91100

92101
describe("When settings require Ctrl+Enter to send", () => {

0 commit comments

Comments
 (0)