summaryrefslogtreecommitdiffstats
path: root/app/import_test.go
diff options
context:
space:
mode:
authorGeorge Goldberg <george@gberg.me>2017-03-06 21:59:20 +0000
committerChristopher Speller <crspeller@gmail.com>2017-03-06 16:59:20 -0500
commitfe3e3f7ef24e956a9f56acbac2b2a2d9c6dc4e81 (patch)
treef9686d6cdaf37422f00f565c2b38495cae01b4ac /app/import_test.go
parentd45b927e42184066554a4112a09429417a7cf0cf (diff)
downloadchat-fe3e3f7ef24e956a9f56acbac2b2a2d9c6dc4e81.tar.gz
chat-fe3e3f7ef24e956a9f56acbac2b2a2d9c6dc4e81.tar.bz2
chat-fe3e3f7ef24e956a9f56acbac2b2a2d9c6dc4e81.zip
Remove FIXME and XXX from bulk import tests. (#5664)
Diffstat (limited to 'app/import_test.go')
-rw-r--r--app/import_test.go20
1 files changed, 17 insertions, 3 deletions
diff --git a/app/import_test.go b/app/import_test.go
index 8867fbec1..e3ed80169 100644
--- a/app/import_test.go
+++ b/app/import_test.go
@@ -294,7 +294,21 @@ func TestImportValidateUserImportData(t *testing.T) {
data.Email = ptrStr("bob@example.com")
- // TODO: Auth Service and Auth Data.
+ data.AuthService = ptrStr("")
+ if err := validateUserImportData(&data); err == nil {
+ t.Fatal("Validation should have failed due to 0-length auth service.")
+ }
+
+ data.AuthService = ptrStr("saml")
+ data.AuthData = ptrStr(strings.Repeat("abcdefghij", 15))
+ if err := validateUserImportData(&data); err == nil {
+ t.Fatal("Validation should have failed due to too long auth data.")
+ }
+
+ data.AuthData = ptrStr("bobbytables")
+ if err := validateUserImportData(&data); err != nil {
+ t.Fatal("Validation should have succeeded with valid auth service and auth data.")
+ }
// Test a valid User with all fields populated.
data = UserImportData{
@@ -571,7 +585,7 @@ func TestImportImportTeam(t *testing.T) {
data := TeamImportData{
Name: ptrStr(model.NewId()),
DisplayName: ptrStr("Display Name"),
- Type: ptrStr("XXX"),
+ Type: ptrStr("XYZ"),
Description: ptrStr("The team description."),
AllowOpenInvite: ptrBool(true),
}
@@ -597,7 +611,7 @@ func TestImportImportTeam(t *testing.T) {
}
// Do an invalid team in apply mode, check db changes.
- data.Type = ptrStr("XXX")
+ data.Type = ptrStr("XYZ")
if err := ImportTeam(&data, false); err == nil {
t.Fatalf("Import should have failed on invalid team.")
}