Compare commits

...
Author SHA1 Message Date
phoenix 2b5cb3a093 Test fixes
Go Release / build-and-release (pull_request) Successful in 6s
Go CI / Test and Lint (pull_request) Failing after 6s
Go CI / Test and Lint (push) Failing after 12s
2026-05-25 22:21:14 -04:00
phoenix c2cde15189 Added test
Go CI / Test and Lint (push) Failing after 5s
Go Release / build-and-release (pull_request) Successful in 6s
Go CI / Test and Lint (pull_request) Failing after 5s
2026-05-25 22:18:02 -04:00
phoenix b8e8621e0d Build fix
Go CI / Test and Lint (push) Successful in 5s
Go Release / build-and-release (pull_request) Successful in 5s
Go CI / Test and Lint (pull_request) Successful in 5s
2026-05-25 22:12:58 -04:00
phoenix 0bf24d929c Build fix
Go CI / Test and Lint (push) Failing after 6s
Go Release / build-and-release (pull_request) Successful in 7s
Go CI / Test and Lint (pull_request) Failing after 5s
2026-05-25 22:12:07 -04:00
+20 -3
View File
@@ -1,5 +1,11 @@
package user
import (
"testing"
"github.com/stretchr/testify/assert"
)
type UserProfile struct {
Usr *User `json:"user"`
@@ -10,14 +16,25 @@ func InitUserProfile(usr *User) (usrProfile *UserProfile, done bool) {
return nil, false
} else {
if len(usr.Password) > 0 {
newUsr := usr
var newUsr User
newUsr = *usr
newUsr.Password = ""
usrProfile.Usr = newUsr
usrProfile.Usr = &newUsr
return usrProfile, true
} else {
usrProfile.Usr = newUsr
usrProfile.Usr = usr
return usrProfile, true
}
}
}
func TestInitUserProfile(t *testing.T) {
usr := User{}
usr.Username = "Bob"
usr.PhoneNumber = "+12224572351"
usr.Password = "TheNight!"
profile, done := InitUserProfile(&usr)
assert.Equal(t, done, true, "Error")
assert.NotEmpty(t, profile, "UserProfile is empty")
}