[MM-29217] Remove Posts.ParentId (#17923)

Этот коммит содержится в:
Claudio Costa
2021-08-17 10:25:22 +02:00
коммит произвёл GitHub
родитель 757dc96461
Коммит d181ae9262
34 изменённых файлов: 22 добавлений и 211 удалений

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

@@ -47,7 +47,6 @@ func TestCreatePost(t *testing.T) {
require.Nil(t, rpost.GetProp(model.PropsAddChannelMember), "newly created post shouldn't have Props['add_channel_member'] set")
post.RootId = rpost.Id
post.ParentId = rpost.Id
_, _, err2 = client.CreatePost(post)
require.NoError(t, err2)
@@ -56,12 +55,6 @@ func TestCreatePost(t *testing.T) {
require.Error(t, err2)
CheckBadRequestStatus(t, resp)
post.RootId = rpost.Id
post.ParentId = "junk"
_, resp, err2 = client.CreatePost(post)
require.Error(t, err2)
CheckBadRequestStatus(t, resp)
post2 := &model.Post{ChannelId: th.BasicChannel2.Id, Message: "zz" + model.NewId() + "a", CreateAt: 123}
rpost2, _, _ := client.CreatePost(post2)
require.NotEqual(t, post2.CreateAt, rpost2.CreateAt, "create at should not match")
@@ -130,7 +123,6 @@ func TestCreatePost(t *testing.T) {
th.RemovePermissionFromRole(model.PermissionUseChannelMentions.Id, model.ChannelUserRoleId)
post.RootId = rpost.Id
post.ParentId = rpost.Id
post.Message = "a post with no channel mentions"
_, _, err = client.CreatePost(post)
require.NoError(t, err)
@@ -148,19 +140,16 @@ func TestCreatePost(t *testing.T) {
}
post.RootId = rpost.Id
post.ParentId = rpost.Id
post.Message = "a post with @channel"
_, _, err = client.CreatePost(post)
require.NoError(t, err)
post.RootId = rpost.Id
post.ParentId = rpost.Id
post.Message = "a post with @all"
_, _, err = client.CreatePost(post)
require.NoError(t, err)
post.RootId = rpost.Id
post.ParentId = rpost.Id
post.Message = "a post with @here"
_, _, err = client.CreatePost(post)
require.NoError(t, err)
@@ -182,7 +171,6 @@ func TestCreatePost(t *testing.T) {
})
post.RootId = ""
post.ParentId = ""
post.Type = model.PostTypeSystemGeneric
_, resp, err := client.CreatePost(post)
require.Error(t, err)
@@ -190,13 +178,11 @@ func TestCreatePost(t *testing.T) {
post.Type = ""
post.RootId = rpost2.Id
post.ParentId = rpost2.Id
_, resp, err = client.CreatePost(post)
require.Error(t, err)
CheckBadRequestStatus(t, resp)
post.RootId = ""
post.ParentId = ""
post.ChannelId = "junk"
_, resp, err = client.CreatePost(post)
require.Error(t, err)
@@ -1703,7 +1689,7 @@ func TestGetPostsForChannelAroundLastUnread(t *testing.T) {
post3 := th.CreatePost()
post4 := th.CreatePost()
post5 := th.CreatePost()
replyPost := &model.Post{ChannelId: channelId, Message: model.NewId(), RootId: post4.Id, ParentId: post4.Id}
replyPost := &model.Post{ChannelId: channelId, Message: model.NewId(), RootId: post4.Id}
post6, _, err := client.CreatePost(replyPost)
require.NoError(t, err)
post7, _, err := client.CreatePost(replyPost)
@@ -1907,7 +1893,6 @@ func TestGetPostsForChannelAroundLastUnread(t *testing.T) {
ChannelId: channelId,
Message: model.NewId(),
RootId: post4.Id,
ParentId: post4.Id,
})
require.NoError(t, err)
post13 := th.CreatePost()