* MM-11434 Only call PreparePostForClient once when creating a post * Have PreparePostForClient provide new metadata when a post already has it and update tests
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
d76069cdbd
Коммит
d018554ef3
@@ -26,7 +26,7 @@ func TestPreparePostListForClient(t *testing.T) {
|
||||
|
||||
postList := model.NewPostList()
|
||||
for i := 0; i < 5; i++ {
|
||||
postList.AddPost(th.CreatePost(th.BasicChannel))
|
||||
postList.AddPost(&model.Post{})
|
||||
}
|
||||
|
||||
clientPostList := th.App.PreparePostListForClient(postList)
|
||||
@@ -66,8 +66,10 @@ func TestPreparePostForClient(t *testing.T) {
|
||||
th := setup()
|
||||
defer th.TearDown()
|
||||
|
||||
post := th.CreatePost(th.BasicChannel)
|
||||
message := post.Message
|
||||
message := model.NewId()
|
||||
post := &model.Post{
|
||||
Message: message,
|
||||
}
|
||||
|
||||
clientPost := th.App.PreparePostForClient(post)
|
||||
|
||||
@@ -93,7 +95,7 @@ func TestPreparePostForClient(t *testing.T) {
|
||||
th := setup()
|
||||
defer th.TearDown()
|
||||
|
||||
post := th.App.PreparePostForClient(th.CreatePost(th.BasicChannel))
|
||||
post := th.CreatePost(th.BasicChannel)
|
||||
|
||||
clientPost := th.App.PreparePostForClient(post)
|
||||
|
||||
@@ -424,10 +426,6 @@ func testProxyLinkedImage(t *testing.T, th *TestHelper, shouldProxy bool) {
|
||||
Message: fmt.Sprintf(postTemplate, imageURL),
|
||||
}
|
||||
|
||||
var err *model.AppError
|
||||
post, err = th.App.CreatePost(post, th.BasicChannel, false)
|
||||
require.Nil(t, err)
|
||||
|
||||
clientPost := th.App.PreparePostForClient(post)
|
||||
|
||||
if shouldProxy {
|
||||
|
||||
Ссылка в новой задаче
Block a user