Skip to content

Commit

Permalink
fix(permissionTableSpec): await to make sure pages are updated
Browse files Browse the repository at this point in the history
  • Loading branch information
NuttyShrimp committed Sep 6, 2024
1 parent d4c3fff commit 1554b06
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions loama/tests/permission-table.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,22 +205,21 @@ test.describe("Permission table", () => {
await accessSwitch.uncheck();
await expect(accessSwitch).not.toBeChecked();

await new Promise(res => setTimeout(res, 3000));

const podPage = await browser.newPage();
// Disable caching
await podPage.route("**/pod1/README", (route) => route.continue());
await podPage.goto("http://localhost:8080/pod1/README");
await expect(podPage.getByText("Welcome to your pod")).toBeVisible();
await expect(podPage.getByText("Not logged in")).toBeVisible();

// Remove access
await accessSwitch.check();
await expect(accessSwitch).toBeEnabled();
await new Promise(res => setTimeout(res, 3000));

await podPage.reload();
await expect(podPage.getByText("Not logged in")).toBeVisible();

// Restore to default state
await accessSwitch.check();
await expect(accessSwitch).toBeEnabled();
await expect(podPage.getByText("Welcome to your pod")).toBeVisible();
});

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

0 comments on commit 1554b06

Please sign in to comment.