diff options
Diffstat (limited to 'api4')
-rw-r--r-- | api4/command_test.go | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/api4/command_test.go b/api4/command_test.go index 8f0303c55..3c61f82b1 100644 --- a/api4/command_test.go +++ b/api4/command_test.go @@ -4,6 +4,7 @@ package api4 import ( + "strings" "testing" "github.com/mattermost/platform/app" @@ -416,10 +417,22 @@ func TestExecuteCommand(t *testing.T) { } posts, err := app.GetPostsPage(channel.Id, 0, 10) - if err != nil || posts == nil || len(posts.Order) != 2 { + if err != nil || posts == nil || len(posts.Order) != 3 { t.Fatal("Test command failed to send") } + cmdPosted := false + for _, post := range posts.Posts { + if strings.Contains(post.Message, "test command response") { + cmdPosted = true + break + } + } + + if !cmdPosted { + t.Fatal("Test command response failed to post") + } + getCmd := &model.Command{ CreatorId: th.BasicUser.Id, TeamId: th.BasicTeam.Id, @@ -440,7 +453,7 @@ func TestExecuteCommand(t *testing.T) { } posts, err = app.GetPostsPage(channel.Id, 0, 10) - if err != nil || posts == nil || len(posts.Order) != 3 { + if err != nil || posts == nil || len(posts.Order) != 4 { t.Fatal("Test command failed to send") } |