Add link creation to rich text editor (#9775)

Add link creation to RTE
This commit is contained in:
Florian Duros 2022-12-23 12:34:15 +01:00 committed by GitHub
parent 88c3864682
commit fe0273b1a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 418 additions and 97 deletions

View file

@ -16,7 +16,7 @@ limitations under the License.
import "@testing-library/jest-dom";
import React from "react";
import { fireEvent, render, screen, waitFor } from "@testing-library/react";
import { act, fireEvent, render, screen, waitFor } from "@testing-library/react";
import MatrixClientContext from "../../../../../src/contexts/MatrixClientContext";
import RoomContext from "../../../../../src/contexts/RoomContext";
@ -117,12 +117,9 @@ describe("SendWysiwygComposer", () => {
expect(screen.getByTestId("PlainTextComposer")).toBeTruthy();
});
describe.each([
{ isRichTextEnabled: true, emptyContent: "<br>" },
{ isRichTextEnabled: false, emptyContent: "" },
])(
describe.each([{ isRichTextEnabled: true }, { isRichTextEnabled: false }])(
"Should focus when receiving an Action.FocusSendMessageComposer action",
({ isRichTextEnabled, emptyContent }) => {
({ isRichTextEnabled }) => {
afterEach(() => {
jest.resetAllMocks();
});
@ -198,7 +195,9 @@ describe("SendWysiwygComposer", () => {
});
// Wait for event dispatch to happen
await flushPromises();
await act(async () => {
await flushPromises();
});
// Then we don't get it because we are disabled
expect(screen.getByRole("textbox")).not.toHaveFocus();