summaryrefslogtreecommitdiffstats
path: root/api4/team_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'api4/team_test.go')
-rw-r--r--api4/team_test.go19
1 files changed, 16 insertions, 3 deletions
diff --git a/api4/team_test.go b/api4/team_test.go
index b517f67fe..421428afa 100644
--- a/api4/team_test.go
+++ b/api4/team_test.go
@@ -12,6 +12,7 @@ import (
"strings"
"testing"
+ "encoding/base64"
"github.com/mattermost/platform/app"
"github.com/mattermost/platform/model"
"github.com/mattermost/platform/utils"
@@ -1345,7 +1346,12 @@ func TestImportTeam(t *testing.T) {
fileResp, resp := th.SystemAdminClient.ImportTeam(data, binary.Size(data), "slack", "Fake_Team_Import.zip", th.BasicTeam.Id)
CheckNoError(t, resp)
- fileReturned := fmt.Sprintf("%s", fileResp)
+ fileData, err := base64.StdEncoding.DecodeString(fileResp["results"])
+ if err != nil {
+ t.Fatal("failed to decode base64 results data")
+ }
+
+ fileReturned := fmt.Sprintf("%s", fileData)
if !strings.Contains(fileReturned, "darth.vader@stardeath.com") {
t.Log(fileReturned)
t.Fatal("failed to report the user was imported")
@@ -1469,7 +1475,7 @@ func TestInviteUsersToTeam(t *testing.T) {
}
func TestGetTeamInviteInfo(t *testing.T) {
- th := Setup().InitBasic()
+ th := Setup().InitBasic().InitSystemAdmin()
defer TearDown()
Client := th.Client
team := th.BasicTeam
@@ -1485,6 +1491,13 @@ func TestGetTeamInviteInfo(t *testing.T) {
t.Fatal("should be empty")
}
+ team.InviteId = "12345678901234567890123456789012"
+ team, resp = th.SystemAdminClient.UpdateTeam(team)
+ CheckNoError(t, resp)
+
+ team, resp = Client.GetTeamInviteInfo(team.InviteId)
+ CheckNoError(t, resp)
+
_, resp = Client.GetTeamInviteInfo("junk")
- CheckBadRequestStatus(t, resp)
+ CheckNotFoundStatus(t, resp)
}