Welcome to mirror list, hosted at ThFree Co, Russian Federation.

math_spec.rb « markdown « features « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6a23d6b78ab5514bc2ed4115be5fd38887f1e000 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
require 'spec_helper'

describe 'Math rendering', :js do
  it 'renders inline and display math correctly' do
    description = <<~MATH
      This math is inline $`a^2+b^2=c^2`$.

      This is on a separate line
      ```math
      a^2+b^2=c^2
      ```
    MATH

    project = create(:project, :public)
    issue = create(:issue, project: project, description: description)

    visit project_issue_path(project, issue)

    expect(page).to have_selector('.katex .mord.mathit', text: 'b')
    expect(page).to have_selector('.katex-display .mord.mathit', text: 'b')
  end
end