fix(test): update test to reflect new user repository

This commit is contained in:
Gabe Kangas 2024-06-25 20:54:59 -07:00
parent f8d3980997
commit ec83e103fa
2 changed files with 4 additions and 5 deletions

View File

@ -5,13 +5,12 @@ import (
"time"
"github.com/owncast/owncast/core/chat/events"
"github.com/owncast/owncast/core/user"
"github.com/owncast/owncast/models"
)
func TestSendChatEvent(t *testing.T) {
timestamp := time.Unix(72, 6).UTC()
user := user.User{
user := models.User{
ID: "user id",
DisplayName: "display name",
DisplayColor: 4,
@ -64,7 +63,7 @@ func TestSendChatEvent(t *testing.T) {
func TestSendChatEventUsernameChanged(t *testing.T) {
timestamp := time.Unix(72, 6).UTC()
user := user.User{
user := models.User{
ID: "user id",
DisplayName: "display name",
DisplayColor: 4,
@ -112,7 +111,7 @@ func TestSendChatEventUsernameChanged(t *testing.T) {
func TestSendChatEventUserJoined(t *testing.T) {
timestamp := time.Unix(72, 6).UTC()
user := user.User{
user := models.User{
ID: "user id",
DisplayName: "display name",
DisplayColor: 4,

View File

@ -79,7 +79,7 @@ func (r *SqlUserRepository) CreateAnonymousUser(displayName string) (*models.Use
// If name isn't available then generate a random one.
if available, _ := r.IsDisplayNameAvailable(displayName); !available {
rand, _ := utils.GenerateRandomString(3)
displayName = displayName + rand
displayName += rand
}
displayColor := utils.GenerateRandomDisplayColor(config.MaxUserColor)