From 15d64fb201848002a25facc3bbffc9535a704df6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Espino?= Date: Wed, 26 Sep 2018 16:34:12 +0200 Subject: MM-7188: Cleaning push notification on every read, not only on channel switch (#9348) * MM-7188: Cleaning push notification on every read, not only on channel switch * Removed unnecesary goroutine * Fixing tests * Applying suggestion from PR --- app/post_test.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'app/post_test.go') diff --git a/app/post_test.go b/app/post_test.go index 2dce8bab8..5d93d3f0f 100644 --- a/app/post_test.go +++ b/app/post_test.go @@ -115,7 +115,7 @@ func TestPostReplyToPostWhereRootPosterLeftChannel(t *testing.T) { CreateAt: 0, } - if _, err := th.App.CreatePostAsUser(&replyPost); err != nil { + if _, err := th.App.CreatePostAsUser(&replyPost, false); err != nil { t.Fatal(err) } } @@ -175,7 +175,7 @@ func TestPostAction(t *testing.T) { }, } - post, err := th.App.CreatePostAsUser(&interactivePost) + post, err := th.App.CreatePostAsUser(&interactivePost, false) require.Nil(t, err) attachments, ok := post.Props["attachments"].([]*model.SlackAttachment) @@ -212,7 +212,7 @@ func TestPostAction(t *testing.T) { }, } - post2, err := th.App.CreatePostAsUser(&menuPost) + post2, err := th.App.CreatePostAsUser(&menuPost, false) require.Nil(t, err) attachments2, ok := post2.Props["attachments"].([]*model.SlackAttachment) @@ -267,7 +267,7 @@ func TestPostAction(t *testing.T) { }, } - postplugin, err := th.App.CreatePostAsUser(&interactivePostPlugin) + postplugin, err := th.App.CreatePostAsUser(&interactivePostPlugin, false) require.Nil(t, err) attachmentsPlugin, ok := postplugin.Props["attachments"].([]*model.SlackAttachment) @@ -308,7 +308,7 @@ func TestPostAction(t *testing.T) { }, } - postSiteURL, err := th.App.CreatePostAsUser(&interactivePostSiteURL) + postSiteURL, err := th.App.CreatePostAsUser(&interactivePostSiteURL, false) require.Nil(t, err) attachmentsSiteURL, ok := postSiteURL.Props["attachments"].([]*model.SlackAttachment) @@ -350,7 +350,7 @@ func TestPostAction(t *testing.T) { }, } - postSubpath, err := th.App.CreatePostAsUser(&interactivePostSubpath) + postSubpath, err := th.App.CreatePostAsUser(&interactivePostSubpath, false) require.Nil(t, err) attachmentsSubpath, ok := postSubpath.Props["attachments"].([]*model.SlackAttachment) @@ -389,7 +389,7 @@ func TestPostChannelMentions(t *testing.T) { CreateAt: 0, } - result, err := th.App.CreatePostAsUser(post) + result, err := th.App.CreatePostAsUser(post, false) require.Nil(t, err) assert.Equal(t, map[string]interface{}{ "mention-test": map[string]interface{}{ -- cgit v1.2.3-1-g7c22