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
+17 -1
View File
@@ -1,5 +1,11 @@
package user
import (
"testing"
"github.com/stretchr/testify/assert"
)
type UserProfile struct {
Usr *User `json:"user"`
@@ -11,7 +17,7 @@ func InitUserProfile(usr *User) (usrProfile *UserProfile, done bool) {
} else {
if len(usr.Password) > 0 {
var newUsr User
newUsr := *usr
newUsr = *usr
newUsr.Password = ""
usrProfile.Usr = &newUsr
@@ -22,3 +28,13 @@ func InitUserProfile(usr *User) (usrProfile *UserProfile, done bool) {
}
}
}
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")
}