Skip to content

Commit

Permalink
fix: bookmark icon should be visible for unauthenticated user
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnAllenTech committed Oct 19, 2024
1 parent 91c4627 commit dcaa401
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions e2e/articles.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ test.describe("Unauthenticated Articles Page", () => {
);
});

test("Should not show bookmark article icon", async ({ page }) => {
test("Should show bookmark article icon", async ({ page }) => {
await page.goto("http://localhost:3000/articles");

await expect(
Expand All @@ -25,7 +25,7 @@ test.describe("Unauthenticated Articles Page", () => {

await expect(
page.locator("article").first().getByLabel("Bookmark this post"),
).toBeHidden();
).toBeVisible();
});
test("Should load more articles when scrolling to the end of the page", async ({
page,
Expand Down Expand Up @@ -164,6 +164,12 @@ test.describe("Authenticated Articles Page", () => {

await expect(page.getByRole("button", { name: "Next" })).toBeVisible();
await page.getByRole("button", { name: "Next" }).click();

await page.route("**/*", async (route) => {
await new Promise((f) => setTimeout(f, 500));
await route.continue();
});

await expect(
page.getByRole("button", { name: "Publish now" }),
).toBeVisible();
Expand Down
2 changes: 1 addition & 1 deletion playwright/.auth/browser.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
}
],
"origins": []
}
}

0 comments on commit dcaa401

Please sign in to comment.