diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-12 09:09:55 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-12 09:09:55 +0000 |
commit | 18f7828977b74bf6e5153594a098ef90e773b3b7 (patch) | |
tree | 49cb1e16d5341d773807ee583357ae6eb167d61f /spec/features/markdown | |
parent | 8191b1571c017378eac33b3ed296ad5216d0a410 (diff) | |
download | gitlab-ce-18f7828977b74bf6e5153594a098ef90e773b3b7.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features/markdown')
-rw-r--r-- | spec/features/markdown/mermaid_spec.rb | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/spec/features/markdown/mermaid_spec.rb b/spec/features/markdown/mermaid_spec.rb index 542caccb18d..1cd5760c30e 100644 --- a/spec/features/markdown/mermaid_spec.rb +++ b/spec/features/markdown/mermaid_spec.rb @@ -94,8 +94,31 @@ describe 'Mermaid rendering', :js do page.find('summary').click svg = page.find('svg.mermaid') - expect(svg[:width].to_i).to be_within(5).of(120) - expect(svg[:height].to_i).to be_within(5).of(220) + expect(svg[:style]).to match(/max-width/) + expect(svg[:width].to_i).to eq(100) + expect(svg[:height].to_i).to eq(0) end end + + it 'correctly sizes mermaid diagram block', :js do + description = <<~MERMAID + ```mermaid + graph TD; + A-->B; + A-->C; + B-->D; + C-->D; + ``` + MERMAID + + project = create(:project, :public) + issue = create(:issue, project: project, description: description) + + visit project_issue_path(project, issue) + + svg = page.find('svg.mermaid') + expect(svg[:style]).to match(/max-width/) + expect(svg[:width].to_i).to eq(100) + expect(svg[:height].to_i).to eq(0) + end end |