Skip to content

A platform for community discussion. Free, open, simple.

DEV: Cover both Markdown code fences in paste system test (#43714)

Alan Guo Xiang Tan0436221ea74b
diff --git a/spec/system/composer/prosemirror_pasting_spec.rb b/spec/system/composer/prosemirror_pasting_spec.rb
index 77a260183eb..197a9310606 100644
--- a/spec/system/composer/prosemirror_pasting_spec.rb
+++ b/spec/system/composer/prosemirror_pasting_spec.rb
@@ -67,13 +67,19 @@ describe "Composer - ProseMirror - Pasting content" do
expect(composer).to have_value("not selected **[bold](www.example.com)** not selected")
end
- it "pastes plain text inside tilde-fenced code blocks and formatted text outside them" do
+ it "lets the user paste bold text as plain text inside backtick and tilde code fences" do
open_composer
composer.toggle_rich_editor
- composer.fill_content("~~~console\nprefix \n~~~")
- composer.move_cursor_after("prefix ")
html = "<strong>bold</strong>"
plain_text = "bold"
+
+ composer.fill_content("```\nprefix \n```")
+ composer.move_cursor_after("prefix ")
+ cdp.copy_paste(html, html: true, plain_text: plain_text)
+ expect(composer).to have_value("```\nprefix bold\n```")
+
+ composer.fill_content("~~~console\nprefix \n~~~")
+ composer.move_cursor_after("prefix ")
cdp.copy_paste(html, html: true, plain_text: plain_text)
expect(composer).to have_value("~~~console\nprefix bold\n~~~")