diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-28 00:10:09 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-28 00:10:09 +0300 |
commit | a28eb91c64e50623d3614892db798656ee7d83ca (patch) | |
tree | 1ef941dbd80704bc6ecc44a4635c1b06bfac8fb1 /spec/features/markdown | |
parent | c3f28c9b07a4eb35fecd351e2d7b51212b6c2342 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features/markdown')
-rw-r--r-- | spec/features/markdown/math_spec.rb | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/spec/features/markdown/math_spec.rb b/spec/features/markdown/math_spec.rb index 441cff7045f..fa23fac2f96 100644 --- a/spec/features/markdown/math_spec.rb +++ b/spec/features/markdown/math_spec.rb @@ -13,14 +13,24 @@ RSpec.describe 'Math rendering', :js do ```math a^2+b^2=c^2 ``` + + This math is aligned + + ```math + \\begin{align*} + a&=b+c \\\\ + d+e&=f + \\end{align*} + ``` MATH issue = create(:issue, project: project, description: description) visit project_issue_path(project, issue) - expect(page).to have_selector('.katex .mord.mathdefault', text: 'b') - expect(page).to have_selector('.katex-display .mord.mathdefault', text: 'b') + expect(page).to have_selector('.katex .mord.mathnormal', text: 'b') + expect(page).to have_selector('.katex-display .mord.mathnormal', text: 'b') + expect(page).to have_selector('.katex-display .mtable .col-align-l .mord.mathnormal', text: 'f') end it 'only renders non XSS links' do @@ -35,7 +45,9 @@ RSpec.describe 'Math rendering', :js do visit project_issue_path(project, issue) page.within '.description > .md' do - expect(page).to have_selector('.katex-error') + # unfortunately there is no class selector for KaTeX's "unsupported command" + # formatting so we must match the style attribute + expect(page).to have_selector('.katex-html .mord[style*="color:"][style*="#cc0000"]', text: '\href') expect(page).to have_selector('.katex-html a', text: 'Gitlab') end end |