FIX: Keep tags when switching to shared draft

This commit is contained in:
Robin Ward
2019-01-22 11:26:52 -05:00
parent f32de88dfc
commit a834245683
2 changed files with 9 additions and 0 deletions

View File

@ -276,6 +276,7 @@ export default DropdownSelectBoxComponent.extend({
options.action = action; options.action = action;
options.categoryId = this.get("composerModel.categoryId"); options.categoryId = this.get("composerModel.categoryId");
options.topicTitle = this.get("composerModel.title"); options.topicTitle = this.get("composerModel.title");
options.tags = this.get("composerModel.tags");
options.skipDraftCheck = true; options.skipDraftCheck = true;
this._openComposer(options); this._openComposer(options);
}, },

View File

@ -7,6 +7,9 @@ acceptance("Composer Actions", {
settings: { settings: {
enable_whispers: true enable_whispers: true
}, },
site: {
can_tag_topics: true
},
beforeEach() { beforeEach() {
_clearSnapshots(); _clearSnapshots();
} }
@ -131,16 +134,21 @@ QUnit.test("shared draft", async assert => {
toggleCheckDraftPopup(true); toggleCheckDraftPopup(true);
const composerActions = selectKit(".composer-actions"); const composerActions = selectKit(".composer-actions");
const tags = selectKit(".mini-tag-chooser");
await visit("/"); await visit("/");
await click("#create-topic"); await click("#create-topic");
await fillIn("#reply-title", "This is the new text for the title"); await fillIn("#reply-title", "This is the new text for the title");
await fillIn(".d-editor-input", "This is the new text for the post"); await fillIn(".d-editor-input", "This is the new text for the post");
await tags.expand();
await tags.selectRowByValue("monkey");
await composerActions.expand(); await composerActions.expand();
await composerActions.selectRowByValue("shared_draft"); await composerActions.selectRowByValue("shared_draft");
assert.equal(tags.header().value(), "monkey", "tags are not reset");
assert.equal( assert.equal(
find("#reply-control .btn-primary.create .d-button-label").text(), find("#reply-control .btn-primary.create .d-button-label").text(),
I18n.t("composer.create_shared_draft") I18n.t("composer.create_shared_draft")