Compare commits

...
Author SHA1 Message Date
phoenix e74dd82211 Code refactoring
Go Release / build-and-release (pull_request) Successful in 7s
Go CI / Test and Lint (pull_request) Failing after 6s
Go CI / Test and Lint (push) Failing after 17s
2026-05-25 22:36:59 -04:00
phoenix 8cfccc2722 Test fix
Go CI / Test and Lint (push) Successful in 6s
Go CI / Test and Lint (pull_request) Successful in 17s
Go Release / build-and-release (pull_request) Successful in 6s
2026-05-25 22:31:18 -04:00
phoenix 801a314421 Test fix
Go CI / Test and Lint (push) Failing after 16s
Go Release / build-and-release (pull_request) Successful in 6s
Go CI / Test and Lint (pull_request) Failing after 6s
2026-05-25 22:30:21 -04:00
phoenix 9565259dc1 Test fix
Go CI / Test and Lint (push) Failing after 6s
Go Release / build-and-release (pull_request) Successful in 5s
Go CI / Test and Lint (pull_request) Failing after 7s
2026-05-25 22:26:38 -04:00
phoenix f05a513926 Created test file
Go CI / Test and Lint (push) Failing after 6s
Go Release / build-and-release (pull_request) Successful in 5s
Go CI / Test and Lint (pull_request) Failing after 6s
2026-05-25 22:24:06 -04:00
2 changed files with 20 additions and 18 deletions
+2 -18
View File
@@ -1,11 +1,5 @@
package user
import (
"testing"
"github.com/stretchr/testify/assert"
)
type UserProfile struct {
Usr *User `json:"user"`
@@ -15,10 +9,9 @@ func InitUserProfile(usr *User) (usrProfile *UserProfile, done bool) {
if usr == nil {
return nil, false
} else {
usrProfile = new(UserProfile)
if len(usr.Password) > 0 {
var newUsr User
newUsr = *usr
newUsr.Password = ""
newUsr := User(Id: usr.Id, PhoneNumber: usr.PhoneNumber, Username: usr.Username, Firstname: usr.Firstname, Lastname: usr.Lastname, Created: usr.Created, LastLogin: usr.LastLogin)
usrProfile.Usr = &newUsr
return usrProfile, true
@@ -29,12 +22,3 @@ 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")
}
+18
View File
@@ -0,0 +1,18 @@
package user
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestInitUserProfile(t *testing.T) {
usr := User{Username: "Bob", PhoneNumber: "+12224572351", Password: "TheNight!"}
profile, done := InitUserProfile(&usr)
assert.Equal(t, done, true, "Error")
assert.NotEmpty(t, profile, "UserProfile is empty")
assert.Empty(t, profile.Usr.Password, "Password should be empty")
}