From 2d277754ebd347fd7c98a55d41f6c4de5e9920cc Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Mon, 18 Dec 2023 21:12:08 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- .../features/content_editor_shared_examples.rb | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'spec/support/shared_examples/features/content_editor_shared_examples.rb') diff --git a/spec/support/shared_examples/features/content_editor_shared_examples.rb b/spec/support/shared_examples/features/content_editor_shared_examples.rb index 0a71658c9e7..d0b2d0c9cae 100644 --- a/spec/support/shared_examples/features/content_editor_shared_examples.rb +++ b/spec/support/shared_examples/features/content_editor_shared_examples.rb @@ -449,6 +449,9 @@ RSpec.shared_examples 'edits content using the content editor' do |params = { before do switch_to_content_editor + type_in_content_editor [modifier_key, 'a'] + type_in_content_editor :delete + type_in_content_editor "Some **rich** _text_ ~~content~~ [link](https://gitlab.com)" type_in_content_editor [modifier_key, 'a'] @@ -488,6 +491,26 @@ RSpec.shared_examples 'edits content using the content editor' do |params = { end end + it 'pastes raw markdown with formatting when pasting inside a markdown code block' do + type_in_content_editor '```md' + type_in_content_editor :enter + type_in_content_editor [modifier_key, 'v'] + + page.within content_editor_testid do + expect(page).to have_selector('pre', text: 'Some **rich** _text_ ~~content~~ [link](https://gitlab.com)') + end + end + + it 'pastes raw markdown without formatting when pasting inside a plaintext code block' do + type_in_content_editor '```' + type_in_content_editor :enter + type_in_content_editor [modifier_key, 'v'] + + page.within content_editor_testid do + expect(page).to have_selector('pre', text: 'Some rich text content link') + end + end + it 'pastes raw text without formatting, stripping whitespaces, if shift + ctrl + v is pressed' do type_in_content_editor " Some **rich**" type_in_content_editor :enter -- cgit v1.2.3