diff options
Diffstat (limited to 'spec/features/markdown')
-rw-r--r-- | spec/features/markdown/copy_as_gfm_spec.rb | 9 | ||||
-rw-r--r-- | spec/features/markdown/markdown_spec.rb | 8 |
2 files changed, 16 insertions, 1 deletions
diff --git a/spec/features/markdown/copy_as_gfm_spec.rb b/spec/features/markdown/copy_as_gfm_spec.rb index c700f878df6..d3aaf339421 100644 --- a/spec/features/markdown/copy_as_gfm_spec.rb +++ b/spec/features/markdown/copy_as_gfm_spec.rb @@ -201,6 +201,15 @@ RSpec.describe 'Copy as GFM', :js do GFM ) + aggregate_failures('CustomEmojiFilter') do + gfm = ':custom_emoji:' + + html = '<img class="emoji" src="custom_emoji.svg" title=":custom_emoji:" height="20" width="20">' + + output_gfm = html_to_gfm(html) + expect(output_gfm.strip).to eq(gfm.strip) + end + aggregate_failures('MathFilter: math as transformed from HTML to KaTeX') do gfm = '$`c = \pm\sqrt{a^2 + b^2}`$' diff --git a/spec/features/markdown/markdown_spec.rb b/spec/features/markdown/markdown_spec.rb index 3208ad82c03..9eff02a8c1b 100644 --- a/spec/features/markdown/markdown_spec.rb +++ b/spec/features/markdown/markdown_spec.rb @@ -133,8 +133,9 @@ RSpec.describe 'GitLab Markdown', :aggregate_failures do expect(doc.at_css('td:contains("Baz")')['align']).to eq 'left' end + # note that 2 are from the hardcoded <sup>, and 2 from footnotes aggregate_failures 'permits superscript elements' do - expect(doc).to have_selector('sup', count: 2) + expect(doc).to have_selector('sup', count: 4) end aggregate_failures 'permits subscript elements' do @@ -148,6 +149,11 @@ RSpec.describe 'GitLab Markdown', :aggregate_failures do aggregate_failures "removes `href` from `a` elements if it's fishy" do expect(doc).not_to have_selector('a[href*="javascript"]') end + + aggregate_failures 'permits footnotes' do + expect(doc).to have_selector('section.footnotes ol li p:contains("Footnote 1")') + expect(doc).to have_selector('section.footnotes ol li p:contains("Footnote with w")') + end end describe 'Escaping' do |