You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-08-09 08:42:50 +03:00
Add a waitFor in case it fixes flaky SecurityRoomSettingsTab test (#10785)
This commit is contained in:
@@ -15,7 +15,7 @@ limitations under the License.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { fireEvent, render, screen, within } from "@testing-library/react";
|
import { fireEvent, render, screen, waitFor, within } from "@testing-library/react";
|
||||||
import { EventType, GuestAccess, HistoryVisibility, JoinRule, MatrixEvent, Room } from "matrix-js-sdk/src/matrix";
|
import { EventType, GuestAccess, HistoryVisibility, JoinRule, MatrixEvent, Room } from "matrix-js-sdk/src/matrix";
|
||||||
import { logger } from "matrix-js-sdk/src/logger";
|
import { logger } from "matrix-js-sdk/src/logger";
|
||||||
|
|
||||||
@@ -353,9 +353,11 @@ describe("<SecurityRoomSettingsTab />", () => {
|
|||||||
expect(within(dialog).getByText("Enable encryption?")).toBeInTheDocument();
|
expect(within(dialog).getByText("Enable encryption?")).toBeInTheDocument();
|
||||||
fireEvent.click(within(dialog).getByText("OK"));
|
fireEvent.click(within(dialog).getByText("OK"));
|
||||||
|
|
||||||
expect(client.sendStateEvent).toHaveBeenCalledWith(room.roomId, EventType.RoomEncryption, {
|
await waitFor(() =>
|
||||||
algorithm: "m.megolm.v1.aes-sha2",
|
expect(client.sendStateEvent).toHaveBeenCalledWith(room.roomId, EventType.RoomEncryption, {
|
||||||
});
|
algorithm: "m.megolm.v1.aes-sha2",
|
||||||
|
}),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("renders world readable option when room is encrypted and history is already set to world readable", () => {
|
it("renders world readable option when room is encrypted and history is already set to world readable", () => {
|
||||||
|
Reference in New Issue
Block a user