mirror of
https://github.com/owncast/owncast.git
synced 2024-10-10 19:16:02 +00:00
fix(test): update test to reflect new user repository
This commit is contained in:
parent
f8d3980997
commit
ec83e103fa
@ -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,
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user