Sha256: be073b21b415f0a6bbcce6b854d95ba10b365230ee2cd3f950f2afbd98696295

Contents?: true

Size: 513 Bytes

Versions: 11

Compression:

Stored size: 513 Bytes

Contents

# frozen_string_literal: true

require 'test_helper'

class TestInjectAnchorsFilter < Minitest::Test
  include TestHelpers

  def setup
    read_html_and_create_parser
  end

  def test_injects_anchors_into_content
    html = @parser.inject_anchors_into_html

    assert_match(%r{<a class="anchor" href="#simple-h1" aria-hidden="true"><span.*span></a>Simple H1}, html)
  end

  def test_does_not_inject_toc
    html = @parser.inject_anchors_into_html

    assert_nil(/<ul class="section-nav">/ =~ html)
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
jekyll-toc-0.15.0.rc test/parser/test_inject_anchors_filter.rb
jekyll-toc-0.14.0 test/parser/test_inject_anchors_filter.rb
jekyll-toc-0.13.1 test/parser/test_inject_anchors_filter.rb
jekyll-toc-0.13.0 test/parser/test_inject_anchors_filter.rb
jekyll-toc-0.12.2 test/parser/test_inject_anchors_filter.rb
jekyll-toc-0.12.1 test/parser/test_inject_anchors_filter.rb
jekyll-toc-0.12.0 test/parser/test_inject_anchors_filter.rb
jekyll-toc-0.12.0.rc3 test/parser/test_inject_anchors_filter.rb
jekyll-toc-0.12.0.rc2 test/parser/test_inject_anchors_filter.rb
jekyll-toc-0.12.0.rc1 test/parser/test_inject_anchors_filter.rb
jekyll-toc-0.11.0 test/parser/test_inject_anchors_filter.rb