diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-11 18:15:55 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-11 18:15:55 +0300 |
commit | a8281ac43424e4b820286823bdb48f068b21d7d3 (patch) | |
tree | f8064c724e33f22402ecc4bd0a8c23ea01e6eac1 /spec/features/markdown/sandboxed_mermaid_spec.rb | |
parent | 22391da1261240ecc15aa15cbb19b089339902b5 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features/markdown/sandboxed_mermaid_spec.rb')
-rw-r--r-- | spec/features/markdown/sandboxed_mermaid_spec.rb | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/spec/features/markdown/sandboxed_mermaid_spec.rb b/spec/features/markdown/sandboxed_mermaid_spec.rb new file mode 100644 index 00000000000..f118fb3db66 --- /dev/null +++ b/spec/features/markdown/sandboxed_mermaid_spec.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe 'Sandboxed Mermaid rendering', :js do + let_it_be(:project) { create(:project, :public) } + + before do + stub_feature_flags(sandboxed_mermaid: true) + end + + it 'includes mermaid frame correctly' do + description = <<~MERMAID + ```mermaid + graph TD; + A-->B; + A-->C; + B-->D; + C-->D; + ``` + MERMAID + + issue = create(:issue, project: project, description: description) + + visit project_issue_path(project, issue) + + wait_for_requests + + expected = %(<iframe src="/-/sandbox/mermaid" sandbox="allow-scripts" frameborder="0" scrolling="no") + expect(page.html).to include(expected) + end +end |