mirror of
https://github.com/mattermost/mattermost.git
synced 2026-03-01 21:01:33 -05:00
It was a good decision in hindsight to keep the public module as 0.x because this would have been a breaking change again. https://mattermost.atlassian.net/browse/MM-53032 ```release-note Changed the Go module path from github.com/mattermost/mattermost-server/server/v8 to github.com/mattermost/mattermost/server/v8. For the public facing module, it's path is also changed from github.com/mattermost/mattermost-server/server/public to github.com/mattermost/mattermost/server/public ```
34 lines
1.6 KiB
Go
34 lines
1.6 KiB
Go
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
package slashcommands
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/mattermost/mattermost/server/public/model"
|
|
)
|
|
|
|
func TestGetCustomStatus(t *testing.T) {
|
|
for msg, expected := range map[string]model.CustomStatus{
|
|
"": {Emoji: model.DefaultCustomStatusEmoji, Text: ""},
|
|
"Hey": {Emoji: model.DefaultCustomStatusEmoji, Text: "Hey"},
|
|
":cactus: Hurt": {Emoji: "cactus", Text: "Hurt"},
|
|
"👅": {Emoji: "tongue", Text: ""},
|
|
"👅 Eating": {Emoji: "tongue", Text: "Eating"},
|
|
"💪🏻 Working out": {Emoji: "muscle_light_skin_tone", Text: "Working out"},
|
|
"👙 Swimming": {Emoji: "bikini", Text: "Swimming"},
|
|
"👙Swimming": {Emoji: model.DefaultCustomStatusEmoji, Text: "👙Swimming"},
|
|
"👍🏿 Okay": {Emoji: "+1_dark_skin_tone", Text: "Okay"},
|
|
"🤴🏾 Dark king": {Emoji: "prince_medium_dark_skin_tone", Text: "Dark king"},
|
|
"⛹🏾♀️ Playing basketball": {Emoji: "basketball_woman_medium_dark_skin_tone", Text: "Playing basketball"},
|
|
"🏋🏿♀️ Weightlifting": {Emoji: "weight_lifting_woman_dark_skin_tone", Text: "Weightlifting"},
|
|
"🏄 Surfing": {Emoji: "surfer", Text: "Surfing"},
|
|
"👨👨👦👦 Family": {Emoji: "family_man_man_boy_boy", Text: "Family"},
|
|
} {
|
|
actual := GetCustomStatus(msg)
|
|
if actual.Emoji != expected.Emoji || actual.Text != expected.Text {
|
|
t.Errorf("expected `%v`, got `%v`", expected, *actual)
|
|
}
|
|
}
|
|
}
|