MM-25563: Add endpoint to fetch only archived channels (#15031)

Automatic Merge
Этот коммит содержится в:
Agniva De Sarker
2020-07-27 17:01:39 +05:30
коммит произвёл GitHub
родитель 29c8b58fc7
Коммит 77f7a97bee
18 изменённых файлов: 166 добавлений и 49 удалений

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

@@ -949,6 +949,18 @@ func TestGetChannelsForTeamForUser(t *testing.T) {
channels, resp = Client.GetChannelsForTeamForUser(th.BasicTeam.Id, th.BasicUser.Id, false, "")
CheckNoError(t, resp)
assert.Equal(t, 5, len(channels))
// Should return all channels including basicDeleted.
channels, resp = Client.GetChannelsForTeamForUser(th.BasicTeam.Id, th.BasicUser.Id, true, "")
CheckNoError(t, resp)
assert.Equal(t, 7, len(channels))
// Should stil return all channels including basicDeleted.
now := time.Now().Add(-time.Minute).Unix() * 1000
Client.GetChannelsForTeamAndUserWithLastDeleteAt(th.BasicTeam.Id, th.BasicUser.Id,
true, int(now), "")
CheckNoError(t, resp)
assert.Equal(t, 7, len(channels))
})
}