PLT-5745 Cleaning up duplicate calls (#7298)
* PLT-5745 Cleaning up duplicate calls * Fixing missing calls * Fixing broken test
Этот коммит содержится в:
коммит произвёл
Harrison Healey
родитель
a12cf549cf
Коммит
1709b94227
@@ -16,17 +16,17 @@ func TestSendNotifications(t *testing.T) {
|
||||
|
||||
AddUserToChannel(th.BasicUser2, th.BasicChannel)
|
||||
|
||||
post1, err := CreatePost(&model.Post{
|
||||
post1, err := CreatePostMissingChannel(&model.Post{
|
||||
UserId: th.BasicUser.Id,
|
||||
ChannelId: th.BasicChannel.Id,
|
||||
Message: "@" + th.BasicUser2.Username,
|
||||
}, th.BasicTeam.Id, true)
|
||||
}, true)
|
||||
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
mentions, err := SendNotifications(post1, th.BasicTeam, th.BasicChannel, th.BasicUser)
|
||||
mentions, err := SendNotifications(post1, th.BasicTeam, th.BasicChannel, th.BasicUser, nil)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
} else if mentions == nil {
|
||||
@@ -42,17 +42,17 @@ func TestSendNotifications(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
post2, err := CreatePost(&model.Post{
|
||||
post2, err := CreatePostMissingChannel(&model.Post{
|
||||
UserId: th.BasicUser.Id,
|
||||
ChannelId: dm.Id,
|
||||
Message: "dm message",
|
||||
}, th.BasicTeam.Id, true)
|
||||
}, true)
|
||||
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
_, err = SendNotifications(post2, th.BasicTeam, dm, th.BasicUser)
|
||||
_, err = SendNotifications(post2, th.BasicTeam, dm, th.BasicUser, nil)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -60,17 +60,17 @@ func TestSendNotifications(t *testing.T) {
|
||||
UpdateActive(th.BasicUser2, false)
|
||||
InvalidateAllCaches()
|
||||
|
||||
post3, err := CreatePost(&model.Post{
|
||||
post3, err := CreatePostMissingChannel(&model.Post{
|
||||
UserId: th.BasicUser.Id,
|
||||
ChannelId: dm.Id,
|
||||
Message: "dm message",
|
||||
}, th.BasicTeam.Id, true)
|
||||
}, true)
|
||||
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
_, err = SendNotifications(post3, th.BasicTeam, dm, th.BasicUser)
|
||||
_, err = SendNotifications(post3, th.BasicTeam, dm, th.BasicUser, nil)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user