summaryrefslogtreecommitdiffstats
path: root/cmd/mattermost/commands/team_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/mattermost/commands/team_test.go')
-rw-r--r--cmd/mattermost/commands/team_test.go57
1 files changed, 57 insertions, 0 deletions
diff --git a/cmd/mattermost/commands/team_test.go b/cmd/mattermost/commands/team_test.go
index 559198256..16ebb5a09 100644
--- a/cmd/mattermost/commands/team_test.go
+++ b/cmd/mattermost/commands/team_test.go
@@ -96,6 +96,25 @@ func TestListTeams(t *testing.T) {
}
}
+func TestListArchivedTeams(t *testing.T) {
+ th := api4.Setup().InitBasic()
+ defer th.TearDown()
+
+ id := model.NewId()
+ name := "name" + id
+ displayName := "Name " + id
+
+ CheckCommand(t, "team", "create", "--name", name, "--display_name", displayName)
+
+ CheckCommand(t, "team", "archive", name)
+
+ output := CheckCommand(t, "team", "list", th.BasicTeam.Name, th.BasicUser.Email)
+
+ if !strings.Contains(string(output), name+" (archived)") {
+ t.Fatal("should have archived team")
+ }
+}
+
func TestSearchTeamsByName(t *testing.T) {
th := api4.Setup().InitBasic()
defer th.TearDown()
@@ -129,3 +148,41 @@ func TestSearchTeamsByDisplayName(t *testing.T) {
t.Fatal("should have the created team")
}
}
+
+func TestSearchArchivedTeamsByName(t *testing.T) {
+ th := api4.Setup().InitBasic()
+ defer th.TearDown()
+
+ id := model.NewId()
+ name := "name" + id
+ displayName := "Name " + id
+
+ CheckCommand(t, "team", "create", "--name", name, "--display_name", displayName)
+
+ CheckCommand(t, "team", "archive", name)
+
+ output := CheckCommand(t, "team", "search", name)
+
+ if !strings.Contains(string(output), "(archived)") {
+ t.Fatal("should have archived team")
+ }
+}
+
+func TestArchiveTeams(t *testing.T) {
+ th := api4.Setup().InitBasic()
+ defer th.TearDown()
+
+ id := model.NewId()
+ name := "name" + id
+ displayName := "Name " + id
+
+ CheckCommand(t, "team", "create", "--name", name, "--display_name", displayName)
+
+ CheckCommand(t, "team", "archive", name)
+
+ output := CheckCommand(t, "team", "list")
+
+ if !strings.Contains(string(output), name+" (archived)") {
+ t.Fatal("should have archived team")
+ }
+}