[MM-19969] - When bulk import finds an already existing post, it should delete existing files (#13037)
Этот коммит содержится в:
коммит произвёл
Ben Schumacher
родитель
d0d6ce0a70
Коммит
4859208744
@@ -2569,6 +2569,7 @@ func TestImportPostAndRepliesWithAttachments(t *testing.T) {
|
||||
}},
|
||||
}
|
||||
|
||||
// import with attachments
|
||||
err = th.App.ImportPost(data, false)
|
||||
assert.Nil(t, err)
|
||||
|
||||
@@ -2578,6 +2579,16 @@ func TestImportPostAndRepliesWithAttachments(t *testing.T) {
|
||||
assert.Contains(t, attachments[1].Path, team.Id)
|
||||
AssertFileIdsInPost(attachments, th, t)
|
||||
|
||||
// import existing post with new attachments
|
||||
data.Attachments = &[]AttachmentImportData{{Path: &testImage}}
|
||||
err = th.App.ImportPost(data, false)
|
||||
assert.Nil(t, err)
|
||||
|
||||
attachments = GetAttachments(user3.Id, th, t)
|
||||
assert.Equal(t, len(attachments), 1)
|
||||
assert.Contains(t, attachments[0].Path, team.Id)
|
||||
AssertFileIdsInPost(attachments, th, t)
|
||||
|
||||
attachments = GetAttachments(user4.Id, th, t)
|
||||
assert.Equal(t, len(attachments), 1)
|
||||
assert.Contains(t, attachments[0].Path, team.Id)
|
||||
|
||||
Ссылка в новой задаче
Block a user