fix: fist integration test #181
All checks were successful
Build Docker Image / Explore-Gitea-Actions (push) Successful in 47s
Build and Push Docker Image / Explore-Gitea-Actions (push) Successful in 52s

This commit was merged in pull request #189.
This commit is contained in:
2024-10-02 23:13:31 +02:00
parent 33380e2124
commit f2a98e5f49
9 changed files with 181 additions and 46 deletions

View File

@@ -25,14 +25,15 @@ func TestSignIn(t *testing.T) {
t.Run("should return user if password is correct", func(t *testing.T) {
t.Parallel()
salt := []byte("salt")
verifiedAt := time.Date(2020, 1, 2, 0, 0, 0, 0, time.UTC)
stub := DbAuthStub{
user: db.NewUser(
uuid.New(),
"test@test.de",
true,
time.Date(2020, 1, 2, 0, 0, 0, 0, time.UTC),
&verifiedAt,
false,
getHashPassword("password", salt),
GetHashPassword("password", salt),
salt,
time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
),
@@ -58,14 +59,15 @@ func TestSignIn(t *testing.T) {
t.Run("should return ErrInvalidCretentials if password is not correct", func(t *testing.T) {
t.Parallel()
salt := []byte("salt")
verifiedAt := time.Date(2020, 1, 2, 0, 0, 0, 0, time.UTC)
stub := DbAuthStub{
user: db.NewUser(
uuid.New(),
"test@test.de",
true,
time.Date(2020, 1, 2, 0, 0, 0, 0, time.UTC),
&verifiedAt,
false,
getHashPassword("password", salt),
GetHashPassword("password", salt),
salt,
time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
),