[MM-42068] Add check to stop custom groups linking to teams and channels (#19633)

* tools updates

* Revert "tools updates"

This reverts commit 6293297b55803c5a263e200ebd80192899666ae9.

* stop custom groups linking to teams and channels

* updating test and changing logic

Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local>
Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MBP.ht.home>
Этот коммит содержится в:
Ben Cooke
2022-02-28 15:06:26 -05:00
коммит произвёл GitHub
родитель f7504037fe
Коммит cc900149c6
2 изменённых файлов: 39 добавлений и 0 удалений

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

@@ -328,6 +328,20 @@ func TestLinkGroupTeam(t *testing.T) {
groupTeam, response, _ := th.Client.LinkGroupSyncable(g.Id, th.BasicTeam.Id, model.GroupSyncableTypeTeam, patch)
assert.Equal(t, http.StatusCreated, response.StatusCode)
assert.NotNil(t, groupTeam)
gid := model.NewId()
g2, app2Err := th.App.CreateGroup(&model.Group{
DisplayName: "dn_" + gid,
Name: model.NewString("name" + gid),
Source: model.GroupSourceCustom,
Description: "description_" + gid,
RemoteId: model.NewString(model.NewId()),
})
assert.Nil(t, app2Err)
_, response, err = th.Client.LinkGroupSyncable(g2.Id, th.BasicTeam.Id, model.GroupSyncableTypeTeam, patch)
require.Error(t, err)
CheckBadRequestStatus(t, response)
}
func TestLinkGroupChannel(t *testing.T) {
@@ -370,6 +384,20 @@ func TestLinkGroupChannel(t *testing.T) {
_, _, err = th.Client.LinkGroupSyncable(g.Id, th.BasicChannel.Id, model.GroupSyncableTypeChannel, patch)
assert.Error(t, err)
gid := model.NewId()
g2, app2Err := th.App.CreateGroup(&model.Group{
DisplayName: "dn_" + gid,
Name: model.NewString("name" + gid),
Source: model.GroupSourceCustom,
Description: "description_" + gid,
RemoteId: model.NewString(model.NewId()),
})
assert.Nil(t, app2Err)
_, response, err = th.Client.LinkGroupSyncable(g2.Id, th.BasicChannel.Id, model.GroupSyncableTypeChannel, patch)
require.Error(t, err)
CheckBadRequestStatus(t, response)
}
func TestUnlinkGroupTeam(t *testing.T) {