FIX: Quoting a quote preserves the original post information (#8746)

Let's say post #2 quotes post number #1. If a user decides to quote the
quote in post #2, it should keep the information of post #1
("user_1, post: 1, topic: X"), instead of replacing with current post
info ("user_2, post: 2, topic: X").
This commit is contained in:
Bianca Nenciu
2020-01-22 16:10:23 +02:00
committed by GitHub
parent 8a89b7e108
commit 7b7e1717f2
11 changed files with 86 additions and 32 deletions

View File

@@ -315,3 +315,21 @@ QUnit.test("View Hidden Replies", async assert => {
assert.equal(find(".gap").length, 0, "it hides gap");
});
QUnit.test("Quoting a quote keeps the original poster name", async assert => {
await visit("/t/internationalization-localization/280");
const selection = window.getSelection();
const range = document.createRange();
range.selectNodeContents($("#post_5 blockquote")[0]);
selection.removeAllRanges();
selection.addRange(range);
await click(".quote-button");
assert.ok(
find(".d-editor-input")
.val()
.indexOf('quote="codinghorror said, post:3, topic:280"') !== -1
);
});