summaryrefslogtreecommitdiffstats
path: root/api4/reaction_test.go
diff options
context:
space:
mode:
authorChris <ccbrown112@gmail.com>2017-12-14 06:31:11 -0600
committerGitHub <noreply@github.com>2017-12-14 06:31:11 -0600
commit95bdb51f4070e7bdb246798106beab6e4c1e11a6 (patch)
treeb443466e69a6a3b24bd2931c467edaa5b6f72693 /api4/reaction_test.go
parent4127474b47731d32f968614ff38249c175d4931c (diff)
downloadchat-95bdb51f4070e7bdb246798106beab6e4c1e11a6.tar.gz
chat-95bdb51f4070e7bdb246798106beab6e4c1e11a6.tar.bz2
chat-95bdb51f4070e7bdb246798106beab6e4c1e11a6.zip
fix reaction test (#7978)
Diffstat (limited to 'api4/reaction_test.go')
-rw-r--r--api4/reaction_test.go15
1 files changed, 5 insertions, 10 deletions
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)