MM-12826 Include list of reactions in post metadata instead of just counts (#9749)

Этот коммит содержится в:
Harrison Healey
2018-10-26 11:26:32 -04:00
родитель 2190c37359
Коммит ba173414d9
5 изменённых файлов: 19 добавлений и 68 удалений

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

@@ -82,38 +82,3 @@ func TestReactionIsValid(t *testing.T) {
t.Fatal("create at should be invalid")
}
}
func TestCountReactions(t *testing.T) {
userId := NewId()
userId2 := NewId()
reactions := []*Reaction{
{
UserId: userId,
EmojiName: "smile",
},
{
UserId: userId,
EmojiName: "frowning",
},
{
UserId: userId2,
EmojiName: "smile",
},
{
UserId: userId2,
EmojiName: "neutral_face",
},
}
reactionCounts := CountReactions(reactions)
if len(reactionCounts) != 3 {
t.Fatal("should've received counts for 3 reactions")
} else if reactionCounts["smile"] != 2 {
t.Fatal("should've received 2 smile reactions")
} else if reactionCounts["frowning"] != 1 {
t.Fatal("should've received 1 frowning reaction")
} else if reactionCounts["neutral_face"] != 1 {
t.Fatal("should've received 2 neutral_face reaction")
}
}