Skip to content

Commit 74e762c

Browse files
committed
fix(permissionTableSpec): await to make sure pages are updated
1 parent c10512a commit 74e762c

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

loama/tests/permission-table.spec.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -205,22 +205,21 @@ test.describe("Permission table", () => {
205205
await accessSwitch.uncheck();
206206
await expect(accessSwitch).not.toBeChecked();
207207

208+
await new Promise(res => setTimeout(res, 3000));
209+
208210
const podPage = await browser.newPage();
209211
// Disable caching
210212
await podPage.route("**/pod1/README", (route) => route.continue());
211213
await podPage.goto("http://localhost:8080/pod1/README");
212-
await expect(podPage.getByText("Welcome to your pod")).toBeVisible();
214+
await expect(podPage.getByText("Not logged in")).toBeVisible();
213215

214216
// Remove access
215217
await accessSwitch.check();
216218
await expect(accessSwitch).toBeEnabled();
219+
await new Promise(res => setTimeout(res, 3000));
217220

218221
await podPage.reload();
219-
await expect(podPage.getByText("Not logged in")).toBeVisible();
220-
221-
// Restore to default state
222-
await accessSwitch.check();
223-
await expect(accessSwitch).toBeEnabled();
222+
await expect(podPage.getByText("Welcome to your pod")).toBeVisible();
224223
});
225224

226225
test("Removing access keeps permissions on re-enabling of access", async ({ page }) => {

0 commit comments

Comments
 (0)