summaryrefslogtreecommitdiff
path: root/spec/lib/banzai/filter/mermaid_filter_spec.rb
blob: ae6725cc14c2c87f1e684ccc1cfe0df187489232 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# frozen_string_literal: true

require 'spec_helper'

describe Banzai::Filter::MermaidFilter do
  include FilterSpecHelper

  it 'adds `js-render-mermaid` class to the `code` 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.css('code').first

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