mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 19:39:30 +08:00
FIX: resume editing when through /new-message (#29637)
"Resume editing" would do nothing when going through the `/new-message` flow.
This seems to be broken since [this commit](b0f6d074be
). which moved `this._setModel` calls around – the same we're doing now, but to different places: the first one needs to happen after the `draft.data` has been set , while the second needs to happen before the `this.open` call.
This commit is contained in:
@ -94,5 +94,24 @@ describe "Composer - discard draft modal", type: :system do
|
||||
|
||||
wait_for(timeout: 5) { Draft.find_by(draft_key: draft_key) == nil }
|
||||
end
|
||||
|
||||
it "resumes draft when using /new-message" do
|
||||
visit "/new-message"
|
||||
|
||||
composer.fill_content("a b c d e f g")
|
||||
composer.close
|
||||
|
||||
expect(discard_draft_modal).to be_open
|
||||
discard_draft_modal.click_save
|
||||
|
||||
visit "/new-message"
|
||||
|
||||
expect(dialog).to be_open
|
||||
expect(page).to have_content(I18n.t("js.drafts.abandon.confirm"))
|
||||
dialog.click_button I18n.t("js.drafts.abandon.no_value")
|
||||
|
||||
expect(composer).to be_opened
|
||||
expect(composer).to have_content("a b c d e f g")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user