summaryrefslogtreecommitdiffstats
path: root/api4/command_test.go
diff options
context:
space:
mode:
authorChris <ccbrown112@gmail.com>2017-09-06 17:12:54 -0500
committerGitHub <noreply@github.com>2017-09-06 17:12:54 -0500
commit1adfd0e9be69a93c7f63bb7afc742c9fafe31aa3 (patch)
tree2766bacc1f045fa685ca3d8310cd6174d0311d09 /api4/command_test.go
parentb84bd21089d305333fa4114b95be70f5ad94ad1b (diff)
downloadchat-1adfd0e9be69a93c7f63bb7afc742c9fafe31aa3.tar.gz
chat-1adfd0e9be69a93c7f63bb7afc742c9fafe31aa3.tar.bz2
chat-1adfd0e9be69a93c7f63bb7afc742c9fafe31aa3.zip
app type transition (#7167)
Diffstat (limited to 'api4/command_test.go')
-rw-r--r--api4/command_test.go17
1 files changed, 8 insertions, 9 deletions
diff --git a/api4/command_test.go b/api4/command_test.go
index 3c61f82b1..71db0456a 100644
--- a/api4/command_test.go
+++ b/api4/command_test.go
@@ -7,7 +7,6 @@ import (
"strings"
"testing"
- "github.com/mattermost/platform/app"
"github.com/mattermost/platform/model"
"github.com/mattermost/platform/utils"
)
@@ -82,7 +81,7 @@ func TestUpdateCommand(t *testing.T) {
Trigger: "trigger1",
}
- cmd1, _ = app.CreateCommand(cmd1)
+ cmd1, _ = th.App.CreateCommand(cmd1)
cmd2 := &model.Command{
CreatorId: GenerateTestId(),
@@ -168,7 +167,7 @@ func TestDeleteCommand(t *testing.T) {
Trigger: "trigger1",
}
- rcmd1, _ := app.CreateCommand(cmd1)
+ rcmd1, _ := th.App.CreateCommand(cmd1)
ok, resp := Client.DeleteCommand(rcmd1.Id)
CheckNoError(t, resp)
@@ -177,7 +176,7 @@ func TestDeleteCommand(t *testing.T) {
t.Fatal("should have returned true")
}
- rcmd1, _ = app.GetCommand(rcmd1.Id)
+ rcmd1, _ = th.App.GetCommand(rcmd1.Id)
if rcmd1 != nil {
t.Fatal("should be nil")
}
@@ -200,7 +199,7 @@ func TestDeleteCommand(t *testing.T) {
Trigger: "trigger2",
}
- rcmd2, _ := app.CreateCommand(cmd2)
+ rcmd2, _ := th.App.CreateCommand(cmd2)
_, resp = th.Client.DeleteCommand(rcmd2.Id)
CheckForbiddenStatus(t, resp)
@@ -405,7 +404,7 @@ func TestExecuteCommand(t *testing.T) {
Trigger: "postcommand",
}
- if _, err := app.CreateCommand(postCmd); err != nil {
+ if _, err := th.App.CreateCommand(postCmd); err != nil {
t.Fatal("failed to create post command")
}
@@ -416,7 +415,7 @@ func TestExecuteCommand(t *testing.T) {
t.Fatal("command response should have returned")
}
- posts, err := app.GetPostsPage(channel.Id, 0, 10)
+ posts, err := th.App.GetPostsPage(channel.Id, 0, 10)
if err != nil || posts == nil || len(posts.Order) != 3 {
t.Fatal("Test command failed to send")
}
@@ -441,7 +440,7 @@ func TestExecuteCommand(t *testing.T) {
Trigger: "getcommand",
}
- if _, err := app.CreateCommand(getCmd); err != nil {
+ if _, err := th.App.CreateCommand(getCmd); err != nil {
t.Fatal("failed to create get command")
}
@@ -452,7 +451,7 @@ func TestExecuteCommand(t *testing.T) {
t.Fatal("command response should have returned")
}
- posts, err = app.GetPostsPage(channel.Id, 0, 10)
+ posts, err = th.App.GetPostsPage(channel.Id, 0, 10)
if err != nil || posts == nil || len(posts.Order) != 4 {
t.Fatal("Test command failed to send")
}