diff --git a/test/plugins/markdown-it-collapsible.js b/test/plugins/markdown-it-collapsible.js index 28066f4..f160338 100644 --- a/test/plugins/markdown-it-collapsible.js +++ b/test/plugins/markdown-it-collapsible.js @@ -12,4 +12,34 @@ describe('markdown-it-collapsible', function() { done(); }); }); + + it('should render expanded', function(done) { + const markdown = '++> Click me!\nHidden text\n++>'; + + mehdown.render(markdown, function(err, html) { + assert.ifError(err); + assert.strictEqual(html, '
\nClick me!

Hidden text

\n
'); + done(); + }); + }); + + it('should support nested collapsibles', function(done) { + const markdown = '++++ Click me!\nHidden text\n+++ Nested\nInner hidden text\n+++\n++++'; + + mehdown.render(markdown, function(err, html) { + assert.ifError(err); + assert.strictEqual(html, '
\nClick me!

Hidden text

\n
\nNested

Inner hidden text

\n
\n
'); + done(); + }); + }); + + it('should support open nested collapsibles', function(done) { + const markdown = '+++> Click me!\nHidden text\n+++ Nested\nInner hidden text\n+++\n+++>'; + + mehdown.render(markdown, function(err, html) { + assert.ifError(err); + assert.strictEqual(html, '
\nClick me!

Hidden text

\n
\nNested

Inner hidden text

\n
\n
'); + done(); + }); + }); }); \ No newline at end of file