Skip to content

Commit

Permalink
Add more tests!
Browse files Browse the repository at this point in the history
  • Loading branch information
Piszmog committed Apr 17, 2024
1 parent 14ffa4b commit 98250a4
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions e2e/signin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,25 @@ func TestSignin(t *testing.T) {
Timeout: playwright.Float(10000),
}))
}

func TestSignin_InvalidCredentials(t *testing.T) {
beforeEach(t)
_, err := page.Goto(getFullPath("signin"))
require.NoError(t, err)

require.NoError(t, page.Locator("#email").Fill("[email protected]"))
require.NoError(t, page.Locator("#password").Fill("password"))
require.NoError(t, page.Locator("button[type=submit]").Click())

require.NoError(t, expect.Locator(page.GetByText("Incorrect email or password")).ToBeVisible())
}

func TestSignin_AuthMiddleware(t *testing.T) {
beforeEach(t)
_, err := page.Goto(getFullPath("") + "/")
require.NoError(t, err)

require.NoError(t, expect.Page(page).ToHaveURL(getFullPath("signin"), playwright.PageAssertionsToHaveURLOptions{
Timeout: playwright.Float(10000),
}))
}

0 comments on commit 98250a4

Please sign in to comment.