Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: element-hq/matrix-react-sdk
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 6e3ef61b7e64522f7b8c81d0ed6140697123853c
Choose a base ref
..
head repository: element-hq/matrix-react-sdk
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 481ea9eab9097657fe749cbb1fa09593e1b48932
Choose a head ref
Showing with 10 additions and 13 deletions.
  1. +1 −1 src/components/views/rooms/MessageComposer.tsx
  2. +9 −12 test/components/views/rooms/MessageComposer-test.tsx
2 changes: 1 addition & 1 deletion src/components/views/rooms/MessageComposer.tsx
Original file line number Diff line number Diff line change
@@ -666,7 +666,7 @@ export class MessageComposer extends React.Component<IProps, IState> {
});

return (
<Tooltip open={isTooltipOpen} label={formatTimeLeft(secondsLeft)} placement="top">
<Tooltip open={isTooltipOpen} description={formatTimeLeft(secondsLeft)} placement="bottom">
<div className={classes} ref={this.ref} role="region" aria-label={_t("a11y|message_composer")}>
{recordingTooltip}
<div className="mx_MessageComposer_wrapper">
21 changes: 9 additions & 12 deletions test/components/views/rooms/MessageComposer-test.tsx
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details.

import * as React from "react";
import { EventType, MatrixEvent, Room, RoomMember, THREAD_RELATION_TYPE } from "matrix-js-sdk/src/matrix";
import { act, fireEvent, prettyDOM, render, screen, waitFor } from "jest-matrix-react";
import { act, fireEvent, render, screen, waitFor } from "jest-matrix-react";
import userEvent from "@testing-library/user-event";

import {
@@ -432,7 +432,7 @@ describe("MessageComposer", () => {
});
});

describe.only("for a LocalRoom", () => {
describe("for a LocalRoom", () => {
const localRoom = new LocalRoom("!room:example.com", cli, cli.getUserId()!);

it("should not show the stickers button", async () => {
@@ -444,7 +444,7 @@ describe("MessageComposer", () => {
});
});

it.only("wysiwyg correctly persists state to and from localStorage", async () => {
it("wysiwyg correctly persists state to and from localStorage", async () => {
const room = mkStubRoom("!roomId:server", "Room 1", cli);
const messageText = "Test Text";
await SettingsStore.setValue("feature_wysiwyg_composer", null, SettingLevel.DEVICE, true);
@@ -458,17 +458,14 @@ describe("MessageComposer", () => {
const key = `mx_wysiwyg_state_${room.roomId}`;

await act(async () => {
console.log(prettyDOM(screen.getByRole("textbox")));
await userEvent.click(screen.getByRole("textbox"));
await userEvent.keyboard(messageText);
expect(screen.getByRole("textbox")).toHaveTextContent(messageText);
// await waitFor(() => expect(screen.getByRole("textbox")).toHaveTextContent(messageText));
});
// fireEvent.input(screen.getByRole("textbox"), {
// data: messageText,
// inputType: "insertText",
// });
// await waitFor(() => expect(screen.getByRole("textbox")).toHaveTextContent(messageText));
fireEvent.input(screen.getByRole("textbox"), {
data: messageText,
inputType: "insertText",
});

await waitFor(() => expect(screen.getByRole("textbox")).toHaveTextContent(messageText));

// Wait for event dispatch to happen
await act(async () => {