summaryrefslogtreecommitdiffstats
path: root/api4/command_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'api4/command_test.go')
-rw-r--r--api4/command_test.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/api4/command_test.go b/api4/command_test.go
index 3be1af061..8c4ce5d50 100644
--- a/api4/command_test.go
+++ b/api4/command_test.go
@@ -214,6 +214,17 @@ func TestListCommands(t *testing.T) {
defer th.TearDown()
Client := th.Client
+ enableCommands := *th.App.Config().ServiceSettings.EnableCommands
+ enableOnlyAdminIntegrations := *th.App.Config().ServiceSettings.EnableOnlyAdminIntegrations
+ defer func() {
+ th.App.UpdateConfig(func(cfg *model.Config) { cfg.ServiceSettings.EnableCommands = &enableCommands })
+ th.App.UpdateConfig(func(cfg *model.Config) {
+ cfg.ServiceSettings.EnableOnlyAdminIntegrations = &enableOnlyAdminIntegrations
+ })
+ }()
+ th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.EnableCommands = true })
+ th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.EnableOnlyAdminIntegrations = true })
+
newCmd := &model.Command{
CreatorId: th.BasicUser.Id,
TeamId: th.BasicTeam.Id,