test: add MakeTestState helper function
This commit is contained in:

committed by
Grail Finder (aider)

parent
78b48b8c71
commit
8b9c440ae5
@ -1,5 +1,7 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
type (
|
||||
UserTeam string
|
||||
UserRole string
|
||||
@ -42,4 +44,21 @@ type UserState struct {
|
||||
Username string
|
||||
Room RoomPublic
|
||||
Team UserTeam
|
||||
Role UserRole
|
||||
}
|
||||
|
||||
func MakeTestState() *UserState {
|
||||
cards := []WordCard{
|
||||
{Word: "hamster", Color: "blue"}, // help to fill wordcards based on roundWords; ai!
|
||||
}
|
||||
room := RoomPublic{
|
||||
ID: "test-id",
|
||||
CreatedAt: time.Now(),
|
||||
CreatorName: "test-name",
|
||||
}
|
||||
return &UserState{
|
||||
Username: "test-name",
|
||||
Team: UserTeamNone,
|
||||
Role: UserRoleNone,
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user