summaryrefslogtreecommitdiffstats
path: root/api4
diff options
context:
space:
mode:
Diffstat (limited to 'api4')
-rw-r--r--api4/command.go2
-rw-r--r--api4/command_test.go8
2 files changed, 10 insertions, 0 deletions
diff --git a/api4/command.go b/api4/command.go
index 64426193d..d051d57f6 100644
--- a/api4/command.go
+++ b/api4/command.go
@@ -305,6 +305,8 @@ func testCommand(c *Context, w http.ResponseWriter, r *http.Request) {
rc := &model.CommandResponse{
Text: "test command response " + msg,
ResponseType: model.COMMAND_RESPONSE_TYPE_IN_CHANNEL,
+ Type: "custom_test",
+ Props: map[string]interface{}{"someprop": "somevalue"},
}
w.Write([]byte(rc.ToJson()))
diff --git a/api4/command_test.go b/api4/command_test.go
index 42c77e7b7..6ef0f4d27 100644
--- a/api4/command_test.go
+++ b/api4/command_test.go
@@ -423,6 +423,14 @@ func TestExecuteCommand(t *testing.T) {
cmdPosted := false
for _, post := range posts.Posts {
if strings.Contains(post.Message, "test command response") {
+ if post.Type != "custom_test" {
+ t.Fatal("wrong type set in slash command post")
+ }
+
+ if post.Props["someprop"] != "somevalue" {
+ t.Fatal("wrong prop set in slash command post")
+ }
+
cmdPosted = true
break
}