MM-14416: Adds new fields to Channels and Teams for use by LDAP groups removals. (#10450)

* MM-14416: Updates tests.

* MM-14416: Adds new fields to models and patches.

* MM-14416: Adds upgrade operations.

* MM-14416: Removes the 'is' from the new field names.

* MM-14416: Some fmting and removes API test change for now.

* MM-14416: Adds team patch test.

* MM-14416: Using sql.NullBool.

* MM-14416: Using sql.NullBool.
Этот коммит содержится в:
Martin Kraft
2019-03-18 10:50:32 -04:00
коммит произвёл Jesús Espino
родитель 683f215bd9
Коммит 16a9489bbb
5 изменённых файлов: 108 добавлений и 42 удалений

Просмотреть файл

@@ -130,3 +130,48 @@ func TestCleanTeamName(t *testing.T) {
t.Fatal("didn't clean name properly")
}
}
func TestTeamPatch(t *testing.T) {
p := &TeamPatch{
DisplayName: new(string),
Description: new(string),
CompanyName: new(string),
AllowedDomains: new(string),
InviteId: new(string),
AllowOpenInvite: new(bool),
GroupConstrained: new(bool),
}
*p.DisplayName = NewId()
*p.Description = NewId()
*p.CompanyName = NewId()
*p.AllowedDomains = NewId()
*p.InviteId = NewId()
*p.AllowOpenInvite = true
*p.GroupConstrained = true
o := Team{Id: NewId()}
o.Patch(p)
if *p.DisplayName != o.DisplayName {
t.Fatal("DisplayName did not update")
}
if *p.Description != o.Description {
t.Fatal("Description did not update")
}
if *p.CompanyName != o.CompanyName {
t.Fatal("CompanyName did not update")
}
if *p.AllowedDomains != o.AllowedDomains {
t.Fatal("AllowedDomains did not update")
}
if *p.InviteId != o.InviteId {
t.Fatal("InviteId did not update")
}
if *p.AllowOpenInvite != o.AllowOpenInvite {
t.Fatal("AllowOpenInvite did not update")
}
if *p.GroupConstrained != o.GroupConstrained.Bool {
t.Fatalf("expected %v got %v", *p.GroupConstrained, o.GroupConstrained.Bool)
}
}