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 432cbad
Showing 1 changed file with 8 additions and 2 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

0 comments on commit 432cbad

Please sign in to comment.