##// END OF EJS Templates
Cherry pick of @jasongrout 's 2bc2f96....
Cherry pick of @jasongrout 's 2bc2f96. Only merged changes to notebook and kernel... (see original comment below). Separate the widget registry from the widget managers; attach widget managers to kernels. Yet to do: take care of clean-up when a kernel is deleted Conflicts: IPython/html/static/notebook/js/widgetmanager.js IPython/html/static/notebook/js/widgets/widget.js

File last commit:

r14178:29af5976
r14622:43cee970
Show More
render_markdown.js
36 lines | 1.3 KiB | application/javascript | JavascriptLexer
//
// Test that a Markdown cell is rendered to HTML.
//
casper.notebook_test(function () {
// Test JavaScript models.
var output = this.evaluate(function () {
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 id=\"foo\">Foo</h1>', 'Markdown JS API works.');
// Test menubar entries.
output = this.evaluate(function () {
$('#to_code').mouseenter().click();
$('#to_markdown').mouseenter().click();
var cell = IPython.notebook.get_selected_cell();
cell.set_text('# Foo');
$('#run_cell').mouseenter().click();
return cell.get_rendered();
});
this.test.assertEquals(output, '<h1 id=\"foo\">Foo</h1>', 'Markdown menubar items work.');
// Test toolbar buttons.
output = this.evaluate(function () {
$('#cell_type').val('code').change();
$('#cell_type').val('markdown').change();
var cell = IPython.notebook.get_selected_cell();
cell.set_text('# Foo');
$('#run_b').click();
return cell.get_rendered();
});
this.test.assertEquals(output, '<h1 id=\"foo\">Foo</h1>', 'Markdown toolbar items work.');
});