MM-57326: [Shared Channels] Message priority, acknowledgement and persistent notifications need to be synced (#30736)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
fa1c77d9b0
Коммит
85391de22a
@@ -109,7 +109,13 @@ func testDeleteAcknowledgementForPost(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("delete acknowledgment for post after 5 min after acknowledged should not delete", func(t *testing.T) {
|
||||
_, nErr := th.App.Srv().Store().PostAcknowledgement().Save(post.Id, th.BasicUser.Id, model.GetMillis()-int64(6*60*1000))
|
||||
acknowledgement := &model.PostAcknowledgement{
|
||||
PostId: post.Id,
|
||||
UserId: th.BasicUser.Id,
|
||||
AcknowledgedAt: model.GetMillis() - int64(6*60*1000),
|
||||
ChannelId: post.ChannelId,
|
||||
}
|
||||
_, nErr := th.App.Srv().Store().PostAcknowledgement().SaveWithModel(acknowledgement)
|
||||
require.NoError(t, nErr)
|
||||
|
||||
acknowledgments, err := th.App.GetAcknowledgementsForPost(post.Id)
|
||||
@@ -180,13 +186,13 @@ func testGetAcknowledgementsForPostList(t *testing.T) {
|
||||
acknowledgementsMap, err := th.App.GetAcknowledgementsForPostList(postList)
|
||||
require.Nil(t, err)
|
||||
|
||||
expected := map[string][]*model.PostAcknowledgement{
|
||||
p1.Id: acks1,
|
||||
p2.Id: acks2,
|
||||
}
|
||||
require.Equal(t, expected, acknowledgementsMap)
|
||||
// Verify p1 acknowledgements (order-agnostic)
|
||||
require.Len(t, acknowledgementsMap[p1.Id], 2)
|
||||
require.ElementsMatch(t, acks1, acknowledgementsMap[p1.Id])
|
||||
|
||||
// Verify p2 acknowledgements (order-agnostic)
|
||||
require.Len(t, acknowledgementsMap[p2.Id], 1)
|
||||
require.ElementsMatch(t, acks2, acknowledgementsMap[p2.Id])
|
||||
require.Nil(t, acknowledgementsMap[p3.Id])
|
||||
})
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user