##// END OF EJS Templates
add nbformat spec to sphinx
add nbformat spec to sphinx

File last commit:

r17346:938f1543
r18586:7fbb095b
Show More
markdown.js
47 lines | 1.7 KiB | application/javascript | JavascriptLexer
David Wyde
Add CasperJS utility functions, and tests for code and...
r13249 //
// Test that a Markdown cell is rendered to HTML.
//
Paul Ivanov
pep8 style function names
r13275 casper.notebook_test(function () {
David Wyde
Add tests for Markdown toolbar and menubar entries.
r13254 // Test JavaScript models.
var output = this.evaluate(function () {
David Wyde
Add CasperJS utility functions, and tests for code and...
r13249 IPython.notebook.to_markdown();
var cell = IPython.notebook.get_selected_cell();
cell.set_text('# Foo');
cell.render();
return cell.get_rendered();
});
Jonathan Frederic
Update JS markdown tests.
r16827 this.test.assertEquals(output.trim(), '<h1 id=\"foo\">Foo</h1>', 'Markdown JS API works.');
David Wyde
Add tests for Markdown toolbar and menubar entries.
r13254
// Test menubar entries.
output = this.evaluate(function () {
$('#to_code').mouseenter().click();
$('#to_markdown').mouseenter().click();
var cell = IPython.notebook.get_selected_cell();
Paul Ivanov
test: changing text of cell resets rendered status
r17346 cell.set_text('# Bar');
David Wyde
Add tests for Markdown toolbar and menubar entries.
r13254 $('#run_cell').mouseenter().click();
return cell.get_rendered();
});
Paul Ivanov
test: changing text of cell resets rendered status
r17346 this.test.assertEquals(output.trim(), '<h1 id=\"bar\">Bar</h1>', 'Markdown menubar items work.');
David Wyde
Add tests for Markdown toolbar and menubar entries.
r13254
// Test toolbar buttons.
output = this.evaluate(function () {
$('#cell_type').val('code').change();
$('#cell_type').val('markdown').change();
var cell = IPython.notebook.get_selected_cell();
Paul Ivanov
test: changing text of cell resets rendered status
r17346 cell.set_text('# Baz');
David Wyde
Add tests for Markdown toolbar and menubar entries.
r13254 $('#run_b').click();
return cell.get_rendered();
});
Paul Ivanov
test: changing text of cell resets rendered status
r17346 this.test.assertEquals(output.trim(), '<h1 id=\"baz\">Baz</h1>', 'Markdown toolbar items work.');
// Test JavaScript models.
var output = this.evaluate(function () {
var cell = IPython.notebook.insert_cell_at_index('markdown', 0);
cell.set_text('# Qux');
cell.render();
return cell.get_rendered();
});
this.test.assertEquals(output.trim(), '<h1 id=\"qux\">Qux</h1>', 'Markdown JS API works.');
David Wyde
Add CasperJS utility functions, and tests for code and...
r13249 });