##// END OF EJS Templates
Add dd tests
Jonathan Frederic -
Show More
@@ -105,7 +105,7 b' casper.notebook_test(function () {'
105 this.validate_state('alt+enter (start in command mode)', 'edit', base_index + 1);
105 this.validate_state('alt+enter (start in command mode)', 'edit', base_index + 1);
106
106
107 // Notebook will now have 8 cells, the index of the last cell will be 7.
107 // Notebook will now have 8 cells, the index of the last cell will be 7.
108 this.test.assertEquals(this.get_cells.length, 8, '*-enter commands added cells where needed.');
108 this.test.assertEquals(this.get_cells().length, 8, '*-enter commands added cells where needed.');
109 this.click_cell(7);
109 this.click_cell(7);
110 this.trigger_keydown('esc');
110 this.trigger_keydown('esc');
111 this.validate_state('click cell ' + 7 + ' and esc', 'command', 7);
111 this.validate_state('click cell ' + 7 + ' and esc', 'command', 7);
@@ -129,8 +129,23 b' casper.notebook_test(function () {'
129 this.test.assertEquals(this.get_cell(7).cell_type, 'markdown', 'm; cell is markdown');
129 this.test.assertEquals(this.get_cell(7).cell_type, 'markdown', 'm; cell is markdown');
130 this.trigger_keydown('y');
130 this.trigger_keydown('y');
131 this.test.assertEquals(this.get_cell(7).cell_type, 'code', 'y; cell is code');
131 this.test.assertEquals(this.get_cell(7).cell_type, 'code', 'y; cell is code');
132
133 this.trigger_keydown('d');
134 this.trigger_keydown('d');
135 this.test.assertEquals(this.get_cells().length, 7, 'dd actually deletes a cell');
136 this.validate_state('dd', 'command', 6);
137
138 // Make sure that if the time between d presses is too long
139 this.trigger_keydown('d');
132 });
140 });
141 this.wait(1000);
142 this.then(function () {
143 this.trigger_keydown('d');
133
144
145 this.test.assertEquals(this.get_cells().length, 6, "d, 1 second wait, d doesn't delete a cell");
146 this.validate_state('d, 1 second wait, d', 'command', 6);
147
148 });
134
149
135 // Utility functions.
150 // Utility functions.
136 this.validate_state = function(message, mode, cell_index) {
151 this.validate_state = function(message, mode, cell_index) {
General Comments 0
You need to be logged in to leave comments. Login now