diff options
Diffstat (limited to 'app/team_test.go')
-rw-r--r-- | app/team_test.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/app/team_test.go b/app/team_test.go index a410d6652..4e0ea82f5 100644 --- a/app/team_test.go +++ b/app/team_test.go @@ -152,4 +152,24 @@ func TestPermanentDeleteTeam(t *testing.T) { if command, err = GetCommand(command.Id); command != nil || err == nil { t.Fatal("command wasn't deleted") } + + // Test deleting a team with no channels. + team = th.CreateTeam() + defer func() { + PermanentDeleteTeam(team) + }() + + if channels, err := GetPublicChannelsForTeam(team.Id, 0, 1000); err != nil { + t.Fatal(err) + } else { + for _, channel := range *channels { + if err2 := PermanentDeleteChannel(channel); err2 != nil { + t.Fatal(err) + } + } + } + + if err := PermanentDeleteTeam(team); err != nil { + t.Fatal(err) + } } |