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
Этот коммит содержится в:
Harrison Healey
2023-12-08 10:35:15 -05:00
коммит произвёл GitHub
родитель 109f4643c6
Коммит b1e745894b
14 изменённых файлов: 320 добавлений и 115 удалений

Просмотреть файл

@@ -366,3 +366,17 @@ func (a *App) deleteReactionsForEmoji(rctx request.CTX, emojiName string) {
rctx.Logger().Warn("Unable to delete reactions when deleting emoji", mlog.String("emoji_name", emojiName), mlog.Err(err))
}
}
func (a *App) confirmEmojiExists(c request.CTX, emojiName string) *model.AppError {
if model.IsSystemEmojiName(emojiName) {
return nil
}
err := model.IsValidEmojiName(emojiName)
if err != nil {
return err
}
_, err = a.GetEmojiByName(c, emojiName)
return err
}