##// END OF EJS Templates
Wrap CasperJS tests in a helper function to reduce boilerplate.
Wrap CasperJS tests in a helper function to reduce boilerplate.

File last commit:

r13253:e04cf2bd
r13253:e04cf2bd
Show More
render_markdown.js
21 lines | 757 B | application/javascript | JavascriptLexer
//
// Test that a Markdown cell is rendered to HTML.
//
casper.notebookTest(function () {
var output = this.evaluate(function() {
// Does it make more sense to test the UI or the JS API here?
//
// $('#cell_type').val('markdown');
// $('#cell_type').change();
// $('#run_b').click();
//
// $('#to_markdown').click(); // fails via jQuery UI menubar
// $('#run_cell').click(); // fails via jQuery UI menubar
IPython.notebook.to_markdown();
var cell = IPython.notebook.get_selected_cell();
cell.set_text('# Foo');
cell.render();
return cell.get_rendered();
});
this.test.assertEquals(output, '<h1>Foo</h1>', 'Markdown converted to HTML.');
});