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

Commit 52a8733

Browse files
committed
Don't look for 'Updating space' message in joinrulesettings test
as it may disappear too quickly for us to see. Fixes element-hq/element-web#25625
1 parent 241df0b commit 52a8733

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

test/components/views/settings/JoinRuleSettings-test.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ limitations under the License.
1515
*/
1616

1717
import React from "react";
18-
import { act, fireEvent, render, screen, within } from "@testing-library/react";
18+
import { act, fireEvent, render, screen, waitFor, within } from "@testing-library/react";
1919
import {
2020
EventType,
2121
GuestAccess,
@@ -225,13 +225,14 @@ describe("<JoinRuleSettings />", () => {
225225
expect(await screen.findByText("Sending invites... (1 out of 2)")).toBeInTheDocument();
226226
deferredInvites.pop()!.resolve({});
227227

228-
// update spaces
229-
expect(await screen.findByText("Updating space...")).toBeInTheDocument();
228+
// Usually we see "Updating space..." in the UI here, but we
229+
// removed the assertion about it, because it sometimes fails,
230+
// presumably because it disappeared too quickly to be visible.
230231

231232
await flushPromises();
232233

233234
// done, modal closed
234-
expect(screen.queryByRole("dialog")).not.toBeInTheDocument();
235+
await waitFor(() => expect(screen.queryByRole("dialog")).not.toBeInTheDocument());
235236
});
236237

237238
it(`upgrades room with no parent spaces or members when changing join rule to ${joinRule}`, async () => {

0 commit comments

Comments
 (0)