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 Oct 18, 2024
1 parent c10512a commit 74e762c
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 74e762c

Please sign in to comment.