summaryrefslogtreecommitdiff
path: root/spec/lib/banzai/filter/mermaid_filter_spec.rb
blob: 532d25e121d4ccdad8375d3f13d11c9e110d3315 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
require 'spec_helper'

describe Banzai::Filter::MermaidFilter do
  include FilterSpecHelper

  it 'adds `js-render-mermaid` class to the `pre` tag' do
    doc = filter("<pre class='code highlight js-syntax-highlight mermaid' lang='mermaid' v-pre='true'><code>graph TD;\n  A--&gt;B;\n</code></pre>")
    result = doc.xpath('descendant-or-self::pre').first

    expect(result[:class]).to include('js-render-mermaid')
  end
end