From 95bdb51f4070e7bdb246798106beab6e4c1e11a6 Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 14 Dec 2017 06:31:11 -0600 Subject: fix reaction test (#7978) --- api4/reaction_test.go | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'api4/reaction_test.go') diff --git a/api4/reaction_test.go b/api4/reaction_test.go index b64d42ce3..93cd754c9 100644 --- a/api4/reaction_test.go +++ b/api4/reaction_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "reflect" + "github.com/stretchr/testify/assert" "github.com/mattermost/mattermost-server/model" ) @@ -180,20 +180,15 @@ func TestGetReactions(t *testing.T) { rr, resp := Client.GetReactions(postId) CheckNoError(t, resp) - if len(rr) != 5 { - t.Fatal("reactions should returned correct length") - } - - if !reflect.DeepEqual(rr, reactions) { - t.Fatal("reactions should have matched") + assert.Len(t, rr, 5) + for _, r := range reactions { + assert.Contains(t, reactions, r) } rr, resp = Client.GetReactions("junk") CheckBadRequestStatus(t, resp) - if len(rr) != 0 { - t.Fatal("reactions should return empty") - } + assert.Empty(t, rr) _, resp = Client.GetReactions(GenerateTestId()) CheckForbiddenStatus(t, resp) -- cgit v1.2.3-1-g7c22