[MM-17069]also unread the given post (#11932)

Этот коммит содержится в:
Guillermo Vayá
2019-09-02 10:00:38 +02:00
коммит произвёл GitHub
родитель 600cf71ee9
Коммит 3629f26bb9
3 изменённых файлов: 22 добавлений и 20 удалений

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

@@ -2686,7 +2686,7 @@ func TestSetChannelUnread(t *testing.T) {
checkHTTPStatus(t, r, 200, false)
unread, err := th.App.GetChannelUnread(c1.Id, u1.Id)
require.Nil(t, err)
assert.Equal(t, int64(1), unread.MsgCount)
assert.Equal(t, int64(2), unread.MsgCount)
})
t.Run("Unread on a private channel", func(t *testing.T) {
@@ -2694,12 +2694,12 @@ func TestSetChannelUnread(t *testing.T) {
assert.Equal(t, 200, r.StatusCode)
unread, err := th.App.GetChannelUnread(th.BasicPrivateChannel.Id, u1.Id)
require.Nil(t, err)
assert.Equal(t, int64(0), unread.MsgCount)
assert.Equal(t, int64(1), unread.MsgCount)
r = th.Client.SetPostUnread(u1.Id, pp1.Id)
assert.Equal(t, 200, r.StatusCode)
unread, err = th.App.GetChannelUnread(th.BasicPrivateChannel.Id, u1.Id)
require.Nil(t, err)
assert.Equal(t, int64(1), unread.MsgCount)
assert.Equal(t, int64(2), unread.MsgCount)
})
t.Run("Can't unread an imaginary post", func(t *testing.T) {