[MM-13500] Adds channel /search_group endpoint (#10805)
* [MM-13500] Adds channel /search_group endpoint * Add LIMIT to the queries * Fix i18n extract * Fix tests * Add a new endpoint to get profiles by group channel ids * Rebase fix
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
604e247135
Коммит
9e9b008f3d
@@ -1127,6 +1127,35 @@ func TestGetUsersByIds(t *testing.T) {
|
||||
CheckUnauthorizedStatus(t, resp)
|
||||
}
|
||||
|
||||
func TestGetUsersByGroupChannelIds(t *testing.T) {
|
||||
th := Setup().InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
gc1, err := th.App.CreateGroupChannel([]string{th.BasicUser.Id, th.SystemAdminUser.Id, th.TeamAdminUser.Id}, th.BasicUser.Id)
|
||||
require.Nil(t, err)
|
||||
|
||||
usersByChannelId, resp := th.Client.GetUsersByGroupChannelIds([]string{gc1.Id})
|
||||
CheckNoError(t, resp)
|
||||
|
||||
users, _ := usersByChannelId[gc1.Id]
|
||||
userIds := []string{}
|
||||
for _, user := range users {
|
||||
userIds = append(userIds, user.Id)
|
||||
}
|
||||
|
||||
require.ElementsMatch(t, []string{th.SystemAdminUser.Id, th.TeamAdminUser.Id}, userIds)
|
||||
|
||||
th.LoginBasic2()
|
||||
usersByChannelId, resp = th.Client.GetUsersByGroupChannelIds([]string{gc1.Id})
|
||||
|
||||
_, ok := usersByChannelId[gc1.Id]
|
||||
require.False(t, ok)
|
||||
|
||||
th.Client.Logout()
|
||||
_, resp = th.Client.GetUsersByGroupChannelIds([]string{gc1.Id})
|
||||
CheckUnauthorizedStatus(t, resp)
|
||||
}
|
||||
|
||||
func TestGetUsersByUsernames(t *testing.T) {
|
||||
th := Setup().InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
Ссылка в новой задаче
Block a user