From f34cd567a6332fe53dae27e6b99b4382505de7a1 Mon Sep 17 00:00:00 2001 From: Saturnino Abril Date: Thu, 31 Aug 2017 04:29:32 +0800 Subject: [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 --- api4/command_test.go | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'api4/command_test.go') 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") } -- cgit v1.2.3-1-g7c22