MM-12192: autocompleteUsers: if a teamId is provided, require it to match the channel's team id (#9481)

* MM-12192: unit test

* MM-1292: autocompleteUsers: if a teamId is provided, require it to match the channel's team id
Этот коммит содержится в:
Jesse Hallam
2018-09-28 10:06:40 -04:00
коммит произвёл Harrison Healey
родитель de5c8622f8
Коммит ee672a72e4
3 изменённых файлов: 23 добавлений и 0 удалений

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

@@ -872,6 +872,11 @@ func TestAutocompleteUsers(t *testing.T) {
if rusers.Users[0].FirstName != "" || rusers.Users[0].LastName != "" {
t.Fatal("should not show first/last name")
}
t.Run("team id, if provided, must match channel's team id", func(t *testing.T) {
rusers, resp = Client.AutocompleteUsersInChannel("otherTeamId", channelId, username, "")
CheckErrorMessage(t, resp, "api.user.autocomplete_users.invalid_team_id")
})
}
func TestGetProfileImage(t *testing.T) {