Rename 'target usernames' with 'target recipients' in Composer (#8606)

* Reapply "Rename 'target usernames' with 'target recipients' in Composer"

This reverts commit 9fe11d0fc3 which
reverted ebb288dc2c.

* DEV: Add test for replying to PM
This commit is contained in:
Bianca Nenciu
2020-01-07 15:33:48 +02:00
committed by GitHub
parent 50357b161e
commit eef21625c6
9 changed files with 120 additions and 47 deletions
@@ -831,3 +831,20 @@ QUnit.test("Image resizing buttons", async assert => {
"it does not unescapes script tags in code blocks"
);
});
QUnit.test("can reply to a private message", async assert => {
let submitted;
/* global server */
server.post("/posts", () => {
submitted = true;
return [200, { "Content-Type": "application/json" }, {}];
});
await visit("/t/34");
await click(".topic-post:eq(0) button.reply");
await fillIn(".d-editor-input", "this is the *content* of the reply");
await click("#reply-control button.create");
assert.ok(submitted);
});
@@ -396,3 +396,15 @@ QUnit.test("allows featured link before choosing a category", assert => {
);
assert.ok(composer.get("canEditTopicFeaturedLink"), "can paste link");
});
QUnit.test("targetRecipientsArray contains types", assert => {
let composer = createComposer({
targetRecipients: "test,codinghorror,staff,foo@bar.com"
});
assert.ok(composer.targetRecipientsArray, [
{ type: "group", name: "test" },
{ type: "user", name: "codinghorror" },
{ type: "group", name: "staff" },
{ type: "email", name: "foo@bar.com" }
]);
});