test: add wrong params test cases for session create

This commit is contained in:
Muyao CHEN 2024-10-17 22:12:31 +02:00
parent 350a6f86d9
commit 86832cf1f9

View File

@ -85,6 +85,14 @@ func TestSessionCreate(t *testing.T) {
Email: "unregistered@error.com", Email: "unregistered@error.com",
Password: "strong password", Password: "strong password",
}, usecase.UserNotExist}, }, usecase.UserNotExist},
{"wrong email", createParams{
Email: "error.com",
Password: "strong password",
}, UserParamsErr},
{"no passwrd", createParams{
Email: "no@error.com",
Password: "",
}, UserParamsErr},
} }
token.Init("secret", 1*time.Second) token.Init("secret", 1*time.Second)