Fix flake in room-security-tab (#33897)
* Fix flake in room-security-tab Wait for the power level change before trying to test. * lint
This commit is contained in:
@@ -24,7 +24,7 @@ test.describe("Roles & Permissions room settings tab", () => {
|
||||
power_level_content_override: {
|
||||
events: {
|
||||
// Set the join rules as lower than the history vis to test an edge case.
|
||||
["m.room.join_rules"]: 80,
|
||||
["m.room.join_rules"]: 50,
|
||||
["m.room.history_visibility"]: 100,
|
||||
},
|
||||
},
|
||||
@@ -99,14 +99,22 @@ test.describe("Roles & Permissions room settings tab", () => {
|
||||
const ourComboBox = settings.getByRole("combobox", { name: user.userId });
|
||||
await ourComboBox.selectOption("Custom level");
|
||||
const ourPl = settings.getByRole("spinbutton", { name: user.userId });
|
||||
await ourPl.fill("80");
|
||||
await ourPl.fill("50");
|
||||
await page.keyboard.press("Tab"); // Shows a warning on
|
||||
|
||||
// Accept the de-op
|
||||
await page.getByRole("button", { name: "Continue" }).click();
|
||||
await settings.getByRole("button", { name: "Apply", disabled: false }).click();
|
||||
|
||||
await app.settings.switchTab("Security & Privacy");
|
||||
// Close and await power level
|
||||
await app.settings.closeDialog();
|
||||
const timeline = page.getByTestId("timeline");
|
||||
await timeline.getByRole("button", { name: "expand" }).click();
|
||||
await expect(
|
||||
timeline.getByText("Alice changed the power level of Alice from Admin to Moderator."),
|
||||
).toBeInViewport();
|
||||
|
||||
settings = await app.settings.openRoomSettings("Security & Privacy");
|
||||
|
||||
await settingsGroupAccess.getByText("Invite only").click();
|
||||
// Element should have automatically set the room to "sharing" history visibility
|
||||
|
||||
Reference in New Issue
Block a user