mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-12 11:45:38 +08:00
test: changing text of cell resets rendered status
This commit is contained in:
parent
d9850e1ab4
commit
781702febf
@ -17,20 +17,31 @@ casper.notebook_test(function () {
|
||||
$('#to_code').mouseenter().click();
|
||||
$('#to_markdown').mouseenter().click();
|
||||
var cell = IPython.notebook.get_selected_cell();
|
||||
cell.set_text('# Foo');
|
||||
cell.set_text('# Bar');
|
||||
$('#run_cell').mouseenter().click();
|
||||
return cell.get_rendered();
|
||||
});
|
||||
this.test.assertEquals(output.trim(), '<h1 id=\"foo\">Foo</h1>', 'Markdown menubar items work.');
|
||||
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('# Foo');
|
||||
cell.set_text('# Baz');
|
||||
$('#run_b').click();
|
||||
return cell.get_rendered();
|
||||
});
|
||||
this.test.assertEquals(output.trim(), '<h1 id=\"foo\">Foo</h1>', 'Markdown toolbar items work.');
|
||||
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.');
|
||||
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user