fix reaction test (#7978)
Этот коммит содержится в:
@@ -7,7 +7,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"reflect"
|
"github.com/stretchr/testify/assert"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/model"
|
"github.com/mattermost/mattermost-server/model"
|
||||||
)
|
)
|
||||||
@@ -180,20 +180,15 @@ func TestGetReactions(t *testing.T) {
|
|||||||
rr, resp := Client.GetReactions(postId)
|
rr, resp := Client.GetReactions(postId)
|
||||||
CheckNoError(t, resp)
|
CheckNoError(t, resp)
|
||||||
|
|
||||||
if len(rr) != 5 {
|
assert.Len(t, rr, 5)
|
||||||
t.Fatal("reactions should returned correct length")
|
for _, r := range reactions {
|
||||||
}
|
assert.Contains(t, reactions, r)
|
||||||
|
|
||||||
if !reflect.DeepEqual(rr, reactions) {
|
|
||||||
t.Fatal("reactions should have matched")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
rr, resp = Client.GetReactions("junk")
|
rr, resp = Client.GetReactions("junk")
|
||||||
CheckBadRequestStatus(t, resp)
|
CheckBadRequestStatus(t, resp)
|
||||||
|
|
||||||
if len(rr) != 0 {
|
assert.Empty(t, rr)
|
||||||
t.Fatal("reactions should return empty")
|
|
||||||
}
|
|
||||||
|
|
||||||
_, resp = Client.GetReactions(GenerateTestId())
|
_, resp = Client.GetReactions(GenerateTestId())
|
||||||
CheckForbiddenStatus(t, resp)
|
CheckForbiddenStatus(t, resp)
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user