Plus to minus shortcuts rebase fixes

This commit is contained in:
Jonathan Frederic 2014-03-20 16:08:37 -07:00
parent 9c6d904f71
commit b80e11d3ce
4 changed files with 35 additions and 35 deletions

View File

@ -47,8 +47,8 @@ casper.notebook_test(function () {
this.test.assertEquals(this.get_cell_text(5), c, 'Verify that cell 5 has the copied contents.');
this.test.assertEquals(this.get_cells_length(), num_cells+2, 'Verify a the cell was added.');
this.select_cell(0);
this.trigger_keydown('shift+v'); // Paste
this.validate_notebook_state('shift+v', 'command', 0);
this.trigger_keydown('shift-v'); // Paste
this.validate_notebook_state('shift-v', 'command', 0);
this.test.assertEquals(this.get_cell_text(0), c, 'Verify that cell 0 has the copied contents.');
this.test.assertEquals(this.get_cells_length(), num_cells+3, 'Verify a the cell was added.');
});

View File

@ -16,53 +16,53 @@ casper.notebook_test(function () {
this.then(function () {
// shift+enter
// shift-enter
// last cell in notebook
var base_index = 3;
this.select_cell(base_index);
this.trigger_keydown('shift+enter'); // Creates one cell
this.validate_notebook_state('shift+enter (no cell below)', 'edit', base_index + 1);
this.trigger_keydown('shift-enter'); // Creates one cell
this.validate_notebook_state('shift-enter (no cell below)', 'edit', base_index + 1);
// not last cell in notebook & starts in edit mode
this.click_cell_editor(base_index);
this.validate_notebook_state('click cell ' + base_index, 'edit', base_index);
this.trigger_keydown('shift+enter');
this.validate_notebook_state('shift+enter (cell exists below)', 'command', base_index + 1);
this.trigger_keydown('shift-enter');
this.validate_notebook_state('shift-enter (cell exists below)', 'command', base_index + 1);
// starts in command mode
this.trigger_keydown('k');
this.validate_notebook_state('k in comand mode', 'command', base_index);
this.trigger_keydown('shift+enter');
this.validate_notebook_state('shift+enter (start in command mode)', 'command', base_index + 1);
this.trigger_keydown('shift-enter');
this.validate_notebook_state('shift-enter (start in command mode)', 'command', base_index + 1);
// ctrl+enter
// ctrl-enter
// last cell in notebook
base_index++;
this.trigger_keydown('ctrl+enter');
this.validate_notebook_state('ctrl+enter (no cell below)', 'command', base_index);
this.trigger_keydown('ctrl-enter');
this.validate_notebook_state('ctrl-enter (no cell below)', 'command', base_index);
// not last cell in notebook & starts in edit mode
this.click_cell_editor(base_index-1);
this.validate_notebook_state('click cell ' + (base_index-1), 'edit', base_index-1);
this.trigger_keydown('ctrl+enter');
this.validate_notebook_state('ctrl+enter (cell exists below)', 'command', base_index-1);
this.trigger_keydown('ctrl-enter');
this.validate_notebook_state('ctrl-enter (cell exists below)', 'command', base_index-1);
// starts in command mode
this.trigger_keydown('j');
this.validate_notebook_state('j in comand mode', 'command', base_index);
this.trigger_keydown('ctrl+enter');
this.validate_notebook_state('ctrl+enter (start in command mode)', 'command', base_index);
this.trigger_keydown('ctrl-enter');
this.validate_notebook_state('ctrl-enter (start in command mode)', 'command', base_index);
// alt+enter
// alt-enter
// last cell in notebook
this.trigger_keydown('alt+enter'); // Creates one cell
this.validate_notebook_state('alt+enter (no cell below)', 'edit', base_index + 1);
this.trigger_keydown('alt-enter'); // Creates one cell
this.validate_notebook_state('alt-enter (no cell below)', 'edit', base_index + 1);
// not last cell in notebook & starts in edit mode
this.click_cell_editor(base_index);
this.validate_notebook_state('click cell ' + base_index, 'edit', base_index);
this.trigger_keydown('alt+enter'); // Creates one cell
this.validate_notebook_state('alt+enter (cell exists below)', 'edit', base_index + 1);
this.trigger_keydown('alt-enter'); // Creates one cell
this.validate_notebook_state('alt-enter (cell exists below)', 'edit', base_index + 1);
// starts in command mode
this.trigger_keydown('esc', 'k');
this.validate_notebook_state('k in comand mode', 'command', base_index);
this.trigger_keydown('alt+enter'); // Creates one cell
this.validate_notebook_state('alt+enter (start in command mode)', 'edit', base_index + 1);
this.trigger_keydown('alt-enter'); // Creates one cell
this.validate_notebook_state('alt-enter (start in command mode)', 'edit', base_index + 1);
// Notebook will now have 8 cells, the index of the last cell will be 7.
this.test.assertEquals(this.get_cells_length(), 8, '*-enter commands added cells where needed.');

View File

@ -15,8 +15,8 @@ casper.notebook_test(function () {
this.trigger_keydown('enter');
this.test.assertEquals(this.get_cell(1).rendered, false, 'enter; cell is unrendered');
this.validate_notebook_state('enter', 'edit', 1);
this.trigger_keydown('ctrl+enter');
this.test.assertEquals(this.get_cell(1).rendered, true, 'ctrl+enter; cell is rendered');
this.trigger_keydown('ctrl-enter');
this.test.assertEquals(this.get_cell(1).rendered, true, 'ctrl-enter; cell is rendered');
this.validate_notebook_state('enter', 'command', 1);
this.trigger_keydown('enter');
this.test.assertEquals(this.get_cell(1).rendered, false, 'enter; cell is unrendered');
@ -25,15 +25,15 @@ casper.notebook_test(function () {
this.validate_notebook_state('select 0', 'command', 0);
this.select_cell(1);
this.validate_notebook_state('select 1', 'command', 1);
this.trigger_keydown('ctrl+enter');
this.test.assertEquals(this.get_cell(1).rendered, true, 'ctrl+enter; cell is rendered');
this.trigger_keydown('ctrl-enter');
this.test.assertEquals(this.get_cell(1).rendered, true, 'ctrl-enter; cell is rendered');
this.select_cell(0);
this.validate_notebook_state('select 0', 'command', 0);
this.trigger_keydown('shift+enter');
this.validate_notebook_state('shift+enter', 'command', 1);
this.test.assertEquals(this.get_cell(1).rendered, true, 'shift+enter; cell is rendered');
this.trigger_keydown('shift+enter'); // Creates one cell
this.validate_notebook_state('shift+enter', 'edit', 2);
this.test.assertEquals(this.get_cell(1).rendered, true, 'shift+enter; cell is rendered');
this.trigger_keydown('shift-enter');
this.validate_notebook_state('shift-enter', 'command', 1);
this.test.assertEquals(this.get_cell(1).rendered, true, 'shift-enter; cell is rendered');
this.trigger_keydown('shift-enter'); // Creates one cell
this.validate_notebook_state('shift-enter', 'edit', 2);
this.test.assertEquals(this.get_cell(1).rendered, true, 'shift-enter; cell is rendered');
});
});

View File

@ -9,12 +9,12 @@ casper.notebook_test(function () {
this.set_cell_text(0, 'abcd');
this.set_cell_editor_cursor(0, 0, 2);
this.test.assertEquals(this.get_cell_text(0), 'abcd', 'Verify that cell 0 has the new contents.');
this.trigger_keydown('alt+-'); // Split
this.trigger_keydown('ctrl-shift-minus'); // Split
this.test.assertEquals(this.get_cell_text(0), 'ab', 'split; Verify that cell 0 has the first half.');
this.test.assertEquals(this.get_cell_text(1), 'cd', 'split; Verify that cell 1 has the second half.');
this.validate_notebook_state('split', 'edit', 1);
this.select_cell(0); // Move up to cell 0
this.trigger_keydown('shift+m'); // Merge
this.trigger_keydown('shift-m'); // Merge
this.validate_notebook_state('merge', 'command', 0);
this.test.assertEquals(this.get_cell_text(0), 'ab\ncd', 'merge; Verify that cell 0 has the merged contents.');
});