diff --git a/IPython/html/tests/notebook/dualmode_cellinsert.js b/IPython/html/tests/notebook/dualmode_cellinsert.js index 59b89a3..e87f895 100644 --- a/IPython/html/tests/notebook/dualmode_cellinsert.js +++ b/IPython/html/tests/notebook/dualmode_cellinsert.js @@ -18,10 +18,25 @@ casper.notebook_test(function () { this.select_cell(2); this.trigger_keydown('a'); // Creates one cell this.test.assertEquals(this.get_cell_text(2), '', 'a; New cell 2 text is empty'); + this.test.assertEquals(this.get_cell(2).cell_type, 'code', 'a; inserts a code cell when on code cell'); this.validate_notebook_state('a', 'command', 2); this.trigger_keydown('b'); // Creates one cell this.test.assertEquals(this.get_cell_text(2), '', 'b; Cell 2 text is still empty'); this.test.assertEquals(this.get_cell_text(3), '', 'b; New cell 3 text is empty'); + this.test.assertEquals(this.get_cell(3).cell_type, 'code', 'b; inserts a code cell when on code cell'); this.validate_notebook_state('b', 'command', 3); }); -}); \ No newline at end of file + this.then(function () { + // Cell insertion + this.select_cell(2); + this.trigger_keydown('m'); // switch it to markdown for the next test + this.trigger_keydown('a'); // Creates one cell + this.test.assertEquals(this.get_cell_text(2), '', 'a; New cell 2 text is empty'); + this.test.assertEquals(this.get_cell(2).cell_type, 'markdown', 'a; inserts a markdown cell when on markdown cell'); + this.validate_notebook_state('a', 'command', 2); + this.trigger_keydown('b'); // Creates one cell + this.test.assertEquals(this.get_cell_text(2), '', 'b; Cell 2 text is still empty'); + this.test.assertEquals(this.get_cell(3).cell_type, 'markdown', 'b; inserts a markdown cell when on markdown cell'); + this.validate_notebook_state('b', 'command', 3); + }); +}); diff --git a/IPython/html/tests/util.js b/IPython/html/tests/util.js index a572190..dad8609 100644 --- a/IPython/html/tests/util.js +++ b/IPython/html/tests/util.js @@ -167,8 +167,6 @@ casper.get_cell_text = function(index){ casper.insert_cell_at_bottom = function(cell_type){ // Inserts a cell at the bottom of the notebook // Returns the new cell's index. - cell_type = cell_type || 'code'; - return this.evaluate(function (cell_type) { var cell = IPython.notebook.insert_cell_at_bottom(cell_type); return IPython.notebook.find_cell_index(cell);