2024-04-05 00:43:25 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2024-04-10 02:25:05 +08:00
|
|
|
describe "Morphed Composer Preview", type: :system do
|
2024-04-05 00:43:25 +08:00
|
|
|
fab!(:user) { Fabricate(:user, refresh_auto_groups: true) }
|
|
|
|
let(:composer) { PageObjects::Components::Composer.new }
|
|
|
|
|
2024-04-10 02:25:05 +08:00
|
|
|
before do
|
2024-04-05 00:43:25 +08:00
|
|
|
SiteSetting.enable_diffhtml_preview = true
|
2024-04-10 02:25:05 +08:00
|
|
|
sign_in user
|
2024-04-05 00:43:25 +08:00
|
|
|
visit("/new-topic")
|
2024-04-10 02:25:05 +08:00
|
|
|
end
|
2024-04-05 00:43:25 +08:00
|
|
|
|
2024-04-10 02:25:05 +08:00
|
|
|
it "keeps details element open" do
|
2024-04-05 00:43:25 +08:00
|
|
|
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
|