summaryrefslogtreecommitdiffstats
path: root/api4/team_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/team_test.go
parentb84bd21089d305333fa4114b95be70f5ad94ad1b (diff)
downloadchat-1adfd0e9be69a93c7f63bb7afc742c9fafe31aa3.tar.gz
chat-1adfd0e9be69a93c7f63bb7afc742c9fafe31aa3.tar.bz2
chat-1adfd0e9be69a93c7f63bb7afc742c9fafe31aa3.zip
app type transition (#7167)
Diffstat (limited to 'api4/team_test.go')
-rw-r--r--api4/team_test.go21
1 files changed, 10 insertions, 11 deletions
diff --git a/api4/team_test.go b/api4/team_test.go
index 1f9772113..22fbb8a6f 100644
--- a/api4/team_test.go
+++ b/api4/team_test.go
@@ -14,7 +14,6 @@ import (
"encoding/base64"
- "github.com/mattermost/platform/app"
"github.com/mattermost/platform/model"
"github.com/mattermost/platform/utils"
)
@@ -346,7 +345,7 @@ func TestSoftDeleteTeam(t *testing.T) {
t.Fatal("should have returned true")
}
- rteam, err := app.GetTeam(team.Id)
+ rteam, err := th.App.GetTeam(team.Id)
if err != nil {
t.Fatal("should have returned archived team")
}
@@ -390,7 +389,7 @@ func TestPermanentDeleteTeam(t *testing.T) {
// The team is deleted in the background, its only soft deleted at this
// time
- rteam, err := app.GetTeam(team.Id)
+ rteam, err := th.App.GetTeam(team.Id)
if err != nil {
t.Fatal("should have returned archived team")
}
@@ -515,7 +514,7 @@ func TestSearchAllTeams(t *testing.T) {
oTeam := th.BasicTeam
oTeam.AllowOpenInvite = true
- updatedTeam, _ := app.UpdateTeam(oTeam)
+ updatedTeam, _ := th.App.UpdateTeam(oTeam)
oTeam.UpdateAt = updatedTeam.UpdateAt
pTeam := &model.Team{DisplayName: "PName", Name: GenerateTestTeamName(), Email: GenerateTestEmail(), Type: model.TEAM_INVITE}
@@ -803,7 +802,7 @@ func TestAddTeamMember(t *testing.T) {
team := th.BasicTeam
otherUser := th.CreateUser()
- if err := app.RemoveUserFromTeam(th.BasicTeam.Id, th.BasicUser2.Id); err != nil {
+ if err := th.App.RemoveUserFromTeam(th.BasicTeam.Id, th.BasicUser2.Id); err != nil {
t.Fatalf(err.Error())
}
@@ -887,7 +886,7 @@ func TestAddTeamMember(t *testing.T) {
// Update user to team admin
UpdateUserToTeamAdmin(th.BasicUser, th.BasicTeam)
- app.InvalidateAllCaches()
+ th.App.InvalidateAllCaches()
*utils.Cfg.TeamSettings.RestrictTeamInvite = model.PERMISSIONS_TEAM_ADMIN
utils.SetIsLicensed(true)
utils.SetLicense(&model.License{Features: &model.Features{}})
@@ -913,7 +912,7 @@ func TestAddTeamMember(t *testing.T) {
// Change permission level to All
UpdateUserToNonTeamAdmin(th.BasicUser, th.BasicTeam)
- app.InvalidateAllCaches()
+ th.App.InvalidateAllCaches()
*utils.Cfg.TeamSettings.RestrictTeamInvite = model.PERMISSIONS_ALL
utils.SetIsLicensed(true)
utils.SetLicense(&model.License{Features: &model.Features{}})
@@ -1019,7 +1018,7 @@ func TestAddTeamMembers(t *testing.T) {
otherUser.Id,
}
- if err := app.RemoveUserFromTeam(th.BasicTeam.Id, th.BasicUser2.Id); err != nil {
+ if err := th.App.RemoveUserFromTeam(th.BasicTeam.Id, th.BasicUser2.Id); err != nil {
t.Fatalf(err.Error())
}
@@ -1101,7 +1100,7 @@ func TestAddTeamMembers(t *testing.T) {
// Update user to team admin
UpdateUserToTeamAdmin(th.BasicUser, th.BasicTeam)
- app.InvalidateAllCaches()
+ th.App.InvalidateAllCaches()
*utils.Cfg.TeamSettings.RestrictTeamInvite = model.PERMISSIONS_TEAM_ADMIN
utils.SetIsLicensed(true)
utils.SetLicense(&model.License{Features: &model.Features{}})
@@ -1127,7 +1126,7 @@ func TestAddTeamMembers(t *testing.T) {
// Change permission level to All
UpdateUserToNonTeamAdmin(th.BasicUser, th.BasicTeam)
- app.InvalidateAllCaches()
+ th.App.InvalidateAllCaches()
*utils.Cfg.TeamSettings.RestrictTeamInvite = model.PERMISSIONS_ALL
utils.SetIsLicensed(true)
utils.SetLicense(&model.License{Features: &model.Features{}})
@@ -1493,7 +1492,7 @@ func TestInviteUsersToTeam(t *testing.T) {
}()
utils.Cfg.TeamSettings.RestrictCreationToDomains = "@example.com"
- err := app.InviteNewUsersToTeam(emailList, th.BasicTeam.Id, th.BasicUser.Id)
+ err := th.App.InviteNewUsersToTeam(emailList, th.BasicTeam.Id, th.BasicUser.Id)
if err == nil {
t.Fatal("Adding users with non-restricted domains was allowed")