Skip to content

Commit

Permalink
test: update test cases
Browse files Browse the repository at this point in the history
Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
  • Loading branch information
kbdharun committed Feb 4, 2025
1 parent 187cae1 commit 9c00dbb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 25 deletions.
30 changes: 15 additions & 15 deletions crates/crates_io_markdown/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -676,26 +676,26 @@ There can also be some text in between!
#[test]
fn markdown_alerts() {
let text = "> [!note]\n> Something of note";
assert_snapshot!(markdown_to_html(text, None, ""), @r#"
assert_snapshot!(markdown_to_html(text, None, ""), @r##"
<div class="markdown-alert markdown-alert-note">
<p class="markdown-alert-title">Note</p>
<p>Something of note</p>
<p class="markdown-alert-title">Note</p>
<p>Something of note</p>
</div>
"#);
"##);
}

#[test]
fn markdown_multiline_block_quotes_complex() {
fn multiline_block_quotes() {
let text = "Paragraph one\n\n>>>\nParagraph two\n\n- one\n- two\n>>>";
assert_snapshot!(markdown_to_html(text, None, ""), @r#"
<p>Paragraph one</p>
<blockquote>
<p>Paragraph two</p>
<ul>
<li>one</li>
<li>two</li>
</ul>
</blockquote>
"#);
assert_snapshot!(markdown_to_html(text, None, ""), @r##"
<p>Paragraph one</p>
<blockquote>
<p>Paragraph two</p>
<ul>
<li>one</li>
<li>two</li>
</ul>
</blockquote>
"##);
}
}
10 changes: 0 additions & 10 deletions tests/acceptance/readme-rendering-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,6 @@ module('Acceptance | README rendering', function (hooks) {
assert.dom('[data-test-readme] pre > code.language-rust.hljs').exists({ count: 2 });
assert.dom('[data-test-readme] pre > code.language-mermaid svg').exists();

assert.dom('[data-test-readme] h3').includesText('GitHub Style Alert');
assert.dom('[data-test-readme] .markdown-alert.markdown-alert-note').exists();
assert.dom('[data-test-readme] .markdown-alert .markdown-alert-title').hasText('Note');
assert.dom('[data-test-readme] .markdown-alert p:nth-of-type(2)').hasText('Something of note');

assert.dom('[data-test-readme] h3').includesText('GitLab Style Multiline Block Quotes');
assert.dom('[data-test-readme] blockquote').exists();
assert.dom('[data-test-readme] blockquote p').hasText('Paragraph two');
assert.dom('[data-test-readme] blockquote ul > li').exists({ count: 2 });

await percySnapshot(assert);
});

Expand Down

0 comments on commit 9c00dbb

Please sign in to comment.