fix(MM-60645): missing emoji on mobile (#30001)
* fix(MM-60645): missing emoji on mobile * removing the `:` completely from being stored or being sent to the server. * proper formatting?
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
3698808625
Коммит
55c2d57f70
@@ -599,6 +599,56 @@ func TestChannelBookmarkPreUpdate(t *testing.T) {
|
||||
assert.Greater(t, bookmark.UpdateAt, originalBookmark.UpdateAt)
|
||||
}
|
||||
|
||||
func TestToBookmarkWithFileInfo(t *testing.T) {
|
||||
testCases := []struct {
|
||||
name string
|
||||
bookmark *ChannelBookmark
|
||||
fileInfo *FileInfo
|
||||
expectedEmoji string
|
||||
}{
|
||||
{
|
||||
name: "emoji with colons",
|
||||
bookmark: &ChannelBookmark{
|
||||
Id: NewId(),
|
||||
DisplayName: "test bookmark",
|
||||
Emoji: ":smile:",
|
||||
Type: ChannelBookmarkLink,
|
||||
},
|
||||
fileInfo: nil,
|
||||
expectedEmoji: "smile",
|
||||
},
|
||||
{
|
||||
name: "emoji without colons",
|
||||
bookmark: &ChannelBookmark{
|
||||
Id: NewId(),
|
||||
DisplayName: "test bookmark",
|
||||
Emoji: "smile",
|
||||
Type: ChannelBookmarkLink,
|
||||
},
|
||||
fileInfo: nil,
|
||||
expectedEmoji: "smile",
|
||||
},
|
||||
{
|
||||
name: "empty emoji",
|
||||
bookmark: &ChannelBookmark{
|
||||
Id: NewId(),
|
||||
DisplayName: "test bookmark",
|
||||
Emoji: "",
|
||||
Type: ChannelBookmarkLink,
|
||||
},
|
||||
fileInfo: nil,
|
||||
expectedEmoji: "",
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
result := tc.bookmark.ToBookmarkWithFileInfo(tc.fileInfo)
|
||||
assert.Equal(t, tc.expectedEmoji, result.Emoji)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestChannelBookmarkPatch(t *testing.T) {
|
||||
p := &ChannelBookmarkPatch{
|
||||
DisplayName: NewPointer(NewId()),
|
||||
|
||||
Ссылка в новой задаче
Block a user