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 удалений

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

@@ -944,19 +944,19 @@ func TestGetChannelsForUser(t *testing.T) {
defer th.App.PermanentDeleteChannel(channel)
defer th.TearDown()
channelList, err := th.App.GetChannelsForUser(th.BasicTeam.Id, th.BasicUser.Id, false)
channelList, err := th.App.GetChannelsForUser(th.BasicTeam.Id, th.BasicUser.Id, false, 0)
require.Nil(t, err)
require.Len(t, *channelList, 4)
th.App.DeleteChannel(channel, th.BasicUser.Id)
// Now we get all the non-archived channels for the user
channelList, err = th.App.GetChannelsForUser(th.BasicTeam.Id, th.BasicUser.Id, false)
channelList, err = th.App.GetChannelsForUser(th.BasicTeam.Id, th.BasicUser.Id, false, 0)
require.Nil(t, err)
require.Len(t, *channelList, 3)
// Now we get all the channels, even though are archived, for the user
channelList, err = th.App.GetChannelsForUser(th.BasicTeam.Id, th.BasicUser.Id, true)
channelList, err = th.App.GetChannelsForUser(th.BasicTeam.Id, th.BasicUser.Id, true, 0)
require.Nil(t, err)
require.Len(t, *channelList, 4)
}