FEATURE: reply as new message to the same recipients

This commit is contained in:
Leo McArdle
2016-11-29 17:59:42 +00:00
committed by Guo Xiang Tan
parent c01cee4aa6
commit c76f6856ea
10 changed files with 99 additions and 10 deletions

View File

@@ -72,3 +72,57 @@ test("Marking a topic as wiki", () => {
ok(find('a.wiki').length === 1, 'it shows the wiki icon');
});
});
test("Reply as new topic", () => {
visit("/t/internationalization-localization/280");
click("button.share:eq(0)");
click(".reply-as-new-topic a");
andThen(() => {
ok(exists('.d-editor-input'), 'the composer input is visible');
equal(
find('.d-editor-input').val().trim(),
"Continuing the discussion from [Internationalization / localization](http://localhost:3000/t/internationalization-localization/280):",
"it fills composer with the ring string"
);
equal(
find('#select2-chosen-1').text().trim(), "feature",
"it fills category selector with the right category"
);
});
});
test("Reply as new message", () => {
visit("/t/pm-for-testing/12");
click("button.share:eq(0)");
click(".reply-as-new-topic a");
andThen(() => {
ok(exists('.d-editor-input'), 'the composer input is visible');
equal(
find('.d-editor-input').val().trim(),
"Continuing the discussion from [PM for testing](http://localhost:3000/t/pm-for-testing/12):",
"it fills composer with the ring string"
);
const targets = find('.item span', '.composer-fields');
equal(
$(targets[0]).text(), "someguy",
"it fills up the composer with the right user to start the PM to"
);
equal(
$(targets[1]).text(), "test",
"it fills up the composer with the right user to start the PM to"
);
equal(
$(targets[2]).text(), "Group",
"it fills up the composer with the right group to start the PM to"
);
});
});

File diff suppressed because one or more lines are too long

View File

@@ -118,6 +118,7 @@ export default function() {
this.get("/t/280.json", () => response(fixturesByUrl['/t/280/1.json']));
this.get("/t/28830.json", () => response(fixturesByUrl['/t/28830/1.json']));
this.get("/t/9.json", () => response(fixturesByUrl['/t/9/1.json']));
this.get("/t/12.json", () => response(fixturesByUrl['/t/12/1.json']));
this.get("/t/id_for/:slug", () => {
return response({id: 280, slug: "internationalization-localization", url: "/t/internationalization-localization/280"});