mirror of
https://github.com/discourse/discourse.git
synced 2024-11-30 12:43:54 -06:00
DEV: Rework two composer actions tests (#18008)
This commit is contained in:
parent
d35ffe8361
commit
870ff48470
@ -422,28 +422,28 @@ acceptance("Composer Actions With New Topic Draft", function (needs) {
|
||||
needs.hooks.afterEach(() => toggleCheckDraftPopup(false));
|
||||
|
||||
test("shared draft", async function (assert) {
|
||||
updateCurrentUser({ has_topic_draft: true });
|
||||
stubDraftResponse();
|
||||
toggleCheckDraftPopup(true);
|
||||
|
||||
const composerActions = selectKit(".composer-actions");
|
||||
const tags = selectKit(".mini-tag-chooser");
|
||||
|
||||
await visit("/");
|
||||
await click("#create-topic");
|
||||
await click("button.open-draft");
|
||||
|
||||
await fillIn(
|
||||
"#reply-title",
|
||||
"This is the new text for the title using 'quotes'"
|
||||
);
|
||||
|
||||
await fillIn(".d-editor-input", "This is the new text for the post");
|
||||
|
||||
const tags = selectKit(".mini-tag-chooser");
|
||||
await tags.expand();
|
||||
await tags.selectRowByValue("monkey");
|
||||
|
||||
const composerActions = selectKit(".composer-actions");
|
||||
await composerActions.expand();
|
||||
await composerActions.selectRowByValue("shared_draft");
|
||||
|
||||
assert.strictEqual(tags.header().value(), "monkey", "tags are not reset");
|
||||
|
||||
assert.strictEqual(
|
||||
query("#reply-title").value,
|
||||
"This is the new text for the title using 'quotes'"
|
||||
@ -458,23 +458,29 @@ acceptance("Composer Actions With New Topic Draft", function (needs) {
|
||||
1,
|
||||
"shared draft icon is visible"
|
||||
);
|
||||
|
||||
assert.strictEqual(count("#reply-control.composing-shared-draft"), 1);
|
||||
await click(".modal-footer .btn.btn-default");
|
||||
});
|
||||
|
||||
test("reply_as_new_topic with new_topic draft", async function (assert) {
|
||||
await visit("/t/internationalization-localization/280");
|
||||
await click(".create.reply");
|
||||
|
||||
stubDraftResponse();
|
||||
|
||||
const composerActions = selectKit(".composer-actions");
|
||||
await composerActions.expand();
|
||||
stubDraftResponse();
|
||||
await composerActions.selectRowByValue("reply_as_new_topic");
|
||||
|
||||
assert.strictEqual(
|
||||
query(".bootbox .modal-body").innerText,
|
||||
I18n.t("composer.composer_actions.reply_as_new_topic.confirm")
|
||||
);
|
||||
await click(".modal-footer .btn.btn-default");
|
||||
await click(".modal-footer .btn.btn-primary");
|
||||
|
||||
assert.ok(
|
||||
query(".d-editor-input").value.startsWith(
|
||||
"Continuing the discussion from"
|
||||
)
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user