MM-55468 Ensure custom status emojis exist (#25501)
* MM-55468 Ensure custom status emojis exist * Fix plugin API unit test * Print underlying error as detailed error message * Convert CustomStatusModal tests to React Testing Library and improve a11y * Don't suggest custom statuses with non-existent emojis * Silence test error by providing fake translation strings
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
109f4643c6
Коммит
b1e745894b
@@ -36,7 +36,7 @@ func (emoji *Emoji) Auditable() map[string]interface{} {
|
||||
}
|
||||
}
|
||||
|
||||
func inSystemEmoji(emojiName string) bool {
|
||||
func IsSystemEmojiName(emojiName string) bool {
|
||||
_, ok := SystemEmojis[emojiName]
|
||||
return ok
|
||||
}
|
||||
@@ -92,7 +92,7 @@ func IsValidEmojiName(name string) *AppError {
|
||||
if name == "" || len(name) > EmojiNameMaxLength || !IsValidAlphaNumHyphenUnderscorePlus(name) {
|
||||
return NewAppError("Emoji.IsValid", "model.emoji.name.app_error", nil, "", http.StatusBadRequest)
|
||||
}
|
||||
if inSystemEmoji(name) {
|
||||
if IsSystemEmojiName(name) {
|
||||
return NewAppError("Emoji.IsValid", "model.emoji.system_emoji_name.app_error", nil, "", http.StatusBadRequest)
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user