Skip to content

Commit 05a981f

Browse files
committed
Changing playwright test to fit our current app
1 parent 56edf49 commit 05a981f

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

frontend/tests/login.spec.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,8 @@ test("Log in with valid email and password ", async ({ page }) => {
5353

5454
await page.waitForURL("/")
5555

56-
await expect(
57-
page.getByText("Welcome back, nice to see you again!"),
58-
).toBeVisible()
56+
// Check that we're on the dashboard by looking for the welcome message
57+
await expect(page.getByText(/Welcome back/)).toBeVisible()
5958
})
6059

6160
test("Log in with invalid email", async ({ page }) => {
@@ -87,9 +86,8 @@ test("Successful log out", async ({ page }) => {
8786

8887
await page.waitForURL("/")
8988

90-
await expect(
91-
page.getByText("Welcome back, nice to see you again!"),
92-
).toBeVisible()
89+
// Check that we're on the dashboard by looking for the welcome message
90+
await expect(page.getByText(/Welcome back/)).toBeVisible()
9391

9492
await page.getByTestId("user-menu").click()
9593
await page.getByRole("menuitem", { name: "Log out" }).click()
@@ -104,9 +102,8 @@ test("Logged-out user cannot access protected routes", async ({ page }) => {
104102

105103
await page.waitForURL("/")
106104

107-
await expect(
108-
page.getByText("Welcome back, nice to see you again!"),
109-
).toBeVisible()
105+
// Check that we're on the dashboard by looking for the welcome message
106+
await expect(page.getByText(/Welcome back/)).toBeVisible()
110107

111108
await page.getByTestId("user-menu").click()
112109
await page.getByRole("menuitem", { name: "Log out" }).click()

0 commit comments

Comments
 (0)