Fix tests

This commit is contained in:
ekzyis 2024-07-12 20:10:47 +02:00
parent 9a92444eee
commit df1886632b
1 changed files with 6 additions and 4 deletions

View File

@ -155,8 +155,9 @@ func TestLnAuthSignupCallbackUserExists(t *testing.T) {
c = e.NewContext(req, rec)
// must throw error because user already exists
err = handler.HandleLnAuthCallback(sc)(c)
assert.ErrorContains(err, "user already exists", "user check failed")
handler.HandleLnAuthCallback(sc)(c)
assert.Equalf(http.StatusBadRequest, rec.Code, "wrong status code")
assert.Contains(rec.Body.String(), "\"reason\":\"user already exists\"", "user check failed")
}
func TestLnAuthLogin(t *testing.T) {
@ -232,8 +233,9 @@ func TestLnAuthLoginCallbackUserNotExists(t *testing.T) {
c = e.NewContext(req, rec)
// must throw error because user does not exist
err = handler.HandleLnAuthCallback(sc)(c)
assert.ErrorContains(err, "user not found", "user check failed")
handler.HandleLnAuthCallback(sc)(c)
assert.Equalf(http.StatusNotFound, rec.Code, "wrong status code")
assert.Contains(rec.Body.String(), "\"reason\":\"user not found\"", "user check failed")
}
func TestLnAuthLoginCallbackUserExists(t *testing.T) {