summaryrefslogtreecommitdiffstats
path: root/api4/command_test.go
diff options
context:
space:
mode:
authorSaturnino Abril <saturnino.abril@gmail.com>2017-08-31 04:29:32 +0800
committerJoram Wilander <jwawilander@gmail.com>2017-08-30 16:29:32 -0400
commitf34cd567a6332fe53dae27e6b99b4382505de7a1 (patch)
treee0d32d1fd51930122e8b18408fba5f30a858780c /api4/command_test.go
parentbb2ca558bb8a015ff850aa3887cbbfdc4e14650d (diff)
downloadchat-f34cd567a6332fe53dae27e6b99b4382505de7a1.tar.gz
chat-f34cd567a6332fe53dae27e6b99b4382505de7a1.tar.bz2
chat-f34cd567a6332fe53dae27e6b99b4382505de7a1.zip
[PLT-5170] Add join the channel system message for the person who created the channel (#7299)
* add join the channel system message for the person who created the channel * update test
Diffstat (limited to 'api4/command_test.go')
-rw-r--r--api4/command_test.go17
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")
}