From 08bd284f0d223a26aa40ffc7755b1ba2fef956d8 Mon Sep 17 00:00:00 2001 From: Bernd Schwarzenbacher Date: Thu, 31 Mar 2016 20:28:27 +0200 Subject: [PATCH] Add tests describing behaviour of #1209 --- notebook/tests/notebook/markdown.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/notebook/tests/notebook/markdown.js b/notebook/tests/notebook/markdown.js index fdd1ee9ee..8b75e1568 100644 --- a/notebook/tests/notebook/markdown.js +++ b/notebook/tests/notebook/markdown.js @@ -60,4 +60,23 @@ casper.notebook_test(function () { var hashes = new Array(level + 1).join('#'); this.test.assertEquals(level_text, hashes + ' ' + text, 'markdown set_heading_level ' + level); } + + // Test markdown code blocks + + var md_render = function (text) { + var cell = Jupyter.notebook.insert_cell_at_bottom('markdown'); + cell.set_text(text); + cell.render(); + return cell.get_rendered(); + }; + + var codeblock = '```\nx = 1\n```' + var result = '
x = 1\n
' + output = this.evaluate(md_render, {text: codeblock}); + this.test.assertEquals(output.trim(), result, 'Markdown code block no language'); + + codeblock = '```aaaa\nx = 1\n```' + result = '
x = 1\n
' + output = this.evaluate(md_render, {text: codeblock}); + this.test.assertEquals(output.trim(), result, 'Markdown code block unknown language'); });