Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
bdougie committed Apr 3, 2024
1 parent 67ad4bb commit ef273d2
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions src/e2e-tests/loggedOutUser.spec.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
import { test, expect } from "@playwright/test";

test("logged out user should see all categories", async ({ page }) => {
test("logged out user should see sign in button", async ({ page }) => {
await page.goto("/");

// the categories that should be visible and functional
const recent = page.locator("a", { hasText: "Recent" });
const login = page.locator("button", { hasText: "Sign in" });

await expect(recent).toHaveAttribute("href", "/recent");
await expect(recent).toBeVisible();
await expect(login).toBeVisible();

const discussed = page.locator("a", { hasText: "Discussed" });

await expect(discussed).toHaveAttribute("href", "/discussed");
await expect(discussed).toBeVisible();

const popular = page.locator("a", { hasText: "Popular" });

await expect(popular).toHaveAttribute("href", "/popular");
await expect(popular).toBeVisible();
});

0 comments on commit ef273d2

Please sign in to comment.