summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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)