MM-33708 - Add MentionCountRoot column to ChannelMembers (#17099)
* added new column for root-only mentions Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
3c21eef110
Коммит
480796a1df
@@ -1231,7 +1231,7 @@ func TestCountMentionsFromPost(t *testing.T) {
|
||||
}, channel, false, true)
|
||||
require.Nil(t, err)
|
||||
|
||||
count, err := th.App.countMentionsFromPost(user2, post1)
|
||||
count, _, err := th.App.countMentionsFromPost(user2, post1)
|
||||
|
||||
assert.Nil(t, err)
|
||||
assert.Equal(t, 0, count)
|
||||
@@ -1270,7 +1270,7 @@ func TestCountMentionsFromPost(t *testing.T) {
|
||||
|
||||
// post1 and post3 should mention the user
|
||||
|
||||
count, err := th.App.countMentionsFromPost(user2, post1)
|
||||
count, _, err := th.App.countMentionsFromPost(user2, post1)
|
||||
|
||||
assert.Nil(t, err)
|
||||
assert.Equal(t, 2, count)
|
||||
@@ -1309,7 +1309,7 @@ func TestCountMentionsFromPost(t *testing.T) {
|
||||
|
||||
// post2 and post3 should mention the user
|
||||
|
||||
count, err := th.App.countMentionsFromPost(user2, post1)
|
||||
count, _, err := th.App.countMentionsFromPost(user2, post1)
|
||||
|
||||
assert.Nil(t, err)
|
||||
assert.Equal(t, 2, count)
|
||||
@@ -1346,7 +1346,7 @@ func TestCountMentionsFromPost(t *testing.T) {
|
||||
}, channel, false, true)
|
||||
require.Nil(t, err)
|
||||
|
||||
count, err := th.App.countMentionsFromPost(user2, post1)
|
||||
count, _, err := th.App.countMentionsFromPost(user2, post1)
|
||||
|
||||
assert.Nil(t, err)
|
||||
assert.Equal(t, 0, count)
|
||||
@@ -1388,7 +1388,7 @@ func TestCountMentionsFromPost(t *testing.T) {
|
||||
}, channel, false, true)
|
||||
require.Nil(t, err)
|
||||
|
||||
count, err := th.App.countMentionsFromPost(user2, post1)
|
||||
count, _, err := th.App.countMentionsFromPost(user2, post1)
|
||||
|
||||
assert.Nil(t, err)
|
||||
assert.Equal(t, 0, count)
|
||||
@@ -1442,7 +1442,7 @@ func TestCountMentionsFromPost(t *testing.T) {
|
||||
|
||||
// post2 should mention the user
|
||||
|
||||
count, err := th.App.countMentionsFromPost(user2, post1)
|
||||
count, _, err := th.App.countMentionsFromPost(user2, post1)
|
||||
|
||||
assert.Nil(t, err)
|
||||
assert.Equal(t, 1, count)
|
||||
@@ -1496,7 +1496,7 @@ func TestCountMentionsFromPost(t *testing.T) {
|
||||
|
||||
// post2 and post5 should mention the user
|
||||
|
||||
count, err := th.App.countMentionsFromPost(user2, post1)
|
||||
count, _, err := th.App.countMentionsFromPost(user2, post1)
|
||||
|
||||
assert.Nil(t, err)
|
||||
assert.Equal(t, 2, count)
|
||||
@@ -1545,7 +1545,7 @@ func TestCountMentionsFromPost(t *testing.T) {
|
||||
|
||||
// should be mentioned by post2 and post3
|
||||
|
||||
count, err := th.App.countMentionsFromPost(user2, post1)
|
||||
count, _, err := th.App.countMentionsFromPost(user2, post1)
|
||||
|
||||
assert.Nil(t, err)
|
||||
assert.Equal(t, 2, count)
|
||||
@@ -1575,12 +1575,12 @@ func TestCountMentionsFromPost(t *testing.T) {
|
||||
}, channel, false, true)
|
||||
require.Nil(t, err)
|
||||
|
||||
count, err := th.App.countMentionsFromPost(user2, post1)
|
||||
count, _, err := th.App.countMentionsFromPost(user2, post1)
|
||||
|
||||
assert.Nil(t, err)
|
||||
assert.Equal(t, 2, count)
|
||||
|
||||
count, err = th.App.countMentionsFromPost(user1, post1)
|
||||
count, _, err = th.App.countMentionsFromPost(user1, post1)
|
||||
|
||||
assert.Nil(t, err)
|
||||
assert.Equal(t, 0, count)
|
||||
@@ -1617,7 +1617,7 @@ func TestCountMentionsFromPost(t *testing.T) {
|
||||
|
||||
// post1 and post3 should mention the user, but we only count post3
|
||||
|
||||
count, err := th.App.countMentionsFromPost(user2, post2)
|
||||
count, _, err := th.App.countMentionsFromPost(user2, post2)
|
||||
|
||||
assert.Nil(t, err)
|
||||
assert.Equal(t, 1, count)
|
||||
@@ -1648,7 +1648,7 @@ func TestCountMentionsFromPost(t *testing.T) {
|
||||
|
||||
// post2 should mention the user
|
||||
|
||||
count, err := th.App.countMentionsFromPost(user2, post1)
|
||||
count, _, err := th.App.countMentionsFromPost(user2, post1)
|
||||
|
||||
assert.Nil(t, err)
|
||||
assert.Equal(t, 1, count)
|
||||
@@ -1695,7 +1695,7 @@ func TestCountMentionsFromPost(t *testing.T) {
|
||||
|
||||
// post4 should mention the user
|
||||
|
||||
count, err := th.App.countMentionsFromPost(user2, post3)
|
||||
count, _, err := th.App.countMentionsFromPost(user2, post3)
|
||||
|
||||
assert.Nil(t, err)
|
||||
assert.Equal(t, 1, count)
|
||||
@@ -1735,7 +1735,7 @@ func TestCountMentionsFromPost(t *testing.T) {
|
||||
|
||||
// post3 should mention the user
|
||||
|
||||
count, err := th.App.countMentionsFromPost(user2, post1)
|
||||
count, _, err := th.App.countMentionsFromPost(user2, post1)
|
||||
|
||||
assert.Nil(t, err)
|
||||
assert.Equal(t, 1, count)
|
||||
@@ -1771,7 +1771,7 @@ func TestCountMentionsFromPost(t *testing.T) {
|
||||
|
||||
// Every post should mention the user
|
||||
|
||||
count, err := th.App.countMentionsFromPost(user2, post1)
|
||||
count, _, err := th.App.countMentionsFromPost(user2, post1)
|
||||
|
||||
assert.Nil(t, err)
|
||||
assert.Equal(t, numPosts, count)
|
||||
|
||||
Ссылка в новой задаче
Block a user