This repository has been archived by the owner on Sep 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
3 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}); |