diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-23 21:07:17 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-23 21:07:17 +0300 |
commit | aee5750044c5bb3a92c4c783504fdb4a62c60fb2 (patch) | |
tree | efaf9e5f839336b5aac4ebc54565ddcdb15958f0 /spec/features/markdown | |
parent | 99c1dfd5e3f39868d65cb006078a8d091992fa54 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features/markdown')
-rw-r--r-- | spec/features/markdown/observability_spec.rb | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/spec/features/markdown/observability_spec.rb b/spec/features/markdown/observability_spec.rb index 0c7d8cc006b..86caf3eb1b1 100644 --- a/spec/features/markdown/observability_spec.rb +++ b/spec/features/markdown/observability_spec.rb @@ -80,4 +80,78 @@ RSpec.describe 'Observability rendering', :js do end end end + + context 'when feature flag is disabled' do + before do + stub_feature_flags(observability_group_tab: false) + end + + context 'when embedding in an issue' do + let(:issue) do + create(:issue, project: project, description: observable_url) + end + + before do + visit project_issue_path(project, issue) + wait_for_requests + end + + it 'does not render iframe in description' do + page.within('.description') do + expect(page.html).not_to include(expected) + expect(page.html).to include(observable_url) + end + end + + it 'does not render iframe in comment' do + expect(page).not_to have_css('.note-text') + + page.within('.js-main-target-form') do + fill_in('note[note]', with: observable_url) + click_button('Comment') + end + + wait_for_requests + + page.within('.note-text') do + expect(page.html).not_to include(expected) + expect(page.html).to include(observable_url) + end + end + end + + context 'when embedding in an MR' do + let(:merge_request) do + create(:merge_request, source_project: project, target_project: project, description: observable_url) + end + + before do + visit merge_request_path(merge_request) + wait_for_requests + end + + it 'does not render iframe in description' do + page.within('.description') do + expect(page.html).not_to include(expected) + expect(page.html).to include(observable_url) + end + end + + it 'does not render iframe in comment' do + expect(page).not_to have_css('.note-text') + + page.within('.js-main-target-form') do + fill_in('note[note]', with: observable_url) + click_button('Comment') + end + + wait_for_requests + + page.within('.note-text') do + expect(page.html).not_to include(expected) + expect(page.html).to include(observable_url) + end + end + end + end end |