##// END OF EJS Templates
Support echoing output from other clients...
Support echoing output from other clients in the zmq console Can result in outputs like: ``` In [1]: 1 [remote]In [1]: 1 [remote]Out[1]: 1 [remote]In [2]: 3 [remote]Out[2]: 3 Out[3]: 1 ``` Note that there will be inconsistencies in prompt numbers because some execution may take place after the in-prompt is drawn.

File last commit:

r17346:938f1543
r18373:fbda5499
Show More
markdown.js
47 lines | 1.7 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.trim(), '<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('# Bar');
$('#run_cell').mouseenter().click();
return cell.get_rendered();
});
this.test.assertEquals(output.trim(), '<h1 id=\"bar\">Bar</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('# Baz');
$('#run_b').click();
return cell.get_rendered();
});
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.');
});