mirror of
https://github.com/discourse/discourse.git
synced 2024-12-24 21:15:21 +08:00
31 lines
760 B
Ruby
31 lines
760 B
Ruby
# frozen_string_literal: true
|
|
|
|
describe "Morphed Composer Preview", type: :system do
|
|
fab!(:user) { Fabricate(:user, refresh_auto_groups: true) }
|
|
let(:composer) { PageObjects::Components::Composer.new }
|
|
|
|
before do
|
|
SiteSetting.enable_diffhtml_preview = true
|
|
sign_in user
|
|
visit("/new-topic")
|
|
end
|
|
|
|
it "keeps details element open" do
|
|
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
|