mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Drop experimental enable_diffhtml_preview setting (#31306)
This was intended to provide a better UX for interactive elements in the composer preview. However, the morphing strategy has irreconcilable conflicts with our `decorateCooked` API, and so we have been unable to enable this by default. Going forward, we're focussing efforts on the WYSIWYG composer to provide this kind of smooth UX, so we're dropping the `enable_diffhtml_preview` approach.
This commit is contained in:
@@ -1,41 +0,0 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
describe "Morphed Composer Preview", type: :system do
|
||||
fab!(:user) { Fabricate(:user, username: "bob", 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 "correctly morphs code blocks" do
|
||||
composer.fill_content <<~MD
|
||||
```js
|
||||
const = {
|
||||
id: t.name,
|
||||
text: t.name,
|
||||
name: t.name,
|
||||
```
|
||||
MD
|
||||
|
||||
within(composer.preview) { expect(find("code.lang-js")).to have_text("const = {") }
|
||||
|
||||
composer.move_cursor_after("const")
|
||||
composer.type_content("ant")
|
||||
|
||||
within(composer.preview) { expect(find("code.lang-js")).to have_text("constant = {") }
|
||||
end
|
||||
|
||||
it "correctly morphs mentions" do
|
||||
composer.fill_content("@bob text")
|
||||
|
||||
within(composer.preview) { expect(find("a.mention")).to have_text("@bob") }
|
||||
|
||||
composer.select_all
|
||||
composer.type_content("@system")
|
||||
|
||||
within(composer.preview) { expect(find("a.mention")).to have_text("@system") }
|
||||
end
|
||||
end
|
||||
@@ -137,26 +137,6 @@ describe "Uploading files in the composer", type: :system do
|
||||
expect(composer).to have_no_in_progress_uploads
|
||||
expect(composer.preview).to have_css(".onebox-placeholder-container")
|
||||
end
|
||||
|
||||
it "shows video player in composer" do
|
||||
SiteSetting.enable_diffhtml_preview = true
|
||||
|
||||
visit "/new-topic"
|
||||
expect(composer).to be_opened
|
||||
topic.fill_in_composer_title("Video upload test")
|
||||
|
||||
file_path_1 = file_from_fixtures("small.mp4", "media").path
|
||||
attach_file(file_path_1) { composer.click_toolbar_button("upload") }
|
||||
|
||||
expect(composer).to have_no_in_progress_uploads
|
||||
expect(composer.preview).to have_css(".video-container video")
|
||||
|
||||
expect(page).to have_css(
|
||||
".video-container video source[src]",
|
||||
visible: false,
|
||||
wait: Capybara.default_max_wait_time,
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
context "when multiple images are uploaded" do
|
||||
|
||||
Reference in New Issue
Block a user