mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FIX: keep details open in preview (#26518)
when morphing is enabled, details elements in the preview will be kept open
This commit is contained in:
30
plugins/discourse-details/spec/system/preview_spec.rb
Normal file
30
plugins/discourse-details/spec/system/preview_spec.rb
Normal file
@ -0,0 +1,30 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
describe "Composer Preview", type: :system do
|
||||
fab!(:user) { Fabricate(:user, refresh_auto_groups: true) }
|
||||
let(:composer) { PageObjects::Components::Composer.new }
|
||||
|
||||
before { sign_in user }
|
||||
|
||||
it "keeps details element open when morphing content" do
|
||||
SiteSetting.enable_diffhtml_preview = true
|
||||
|
||||
visit("/new-topic")
|
||||
|
||||
composer.type_content <<~MD
|
||||
[details=Velcro]
|
||||
What a rip-off!
|
||||
[/details]
|
||||
MD
|
||||
|
||||
within(composer.preview) do
|
||||
find("details").click
|
||||
expect(page).to have_css("details[open]")
|
||||
end
|
||||
|
||||
composer.move_cursor_after("rip-off!")
|
||||
composer.type_content(" :person_facepalming:")
|
||||
|
||||
within(composer.preview) { expect(page).to have_css("details[open] img.emoji") }
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user