##// END OF EJS Templates
Initial messing around....
Initial messing around. Latex tab completion will have to be done outside the normal completer logic as the completer line splitting logic uses \\ as a special character to split lines on. I probably want to put the latex completions first and it if finds any matches, don't do any other completion logic. The only issue is that might short circuit dir/path matching on windows. Hmmm.

File last commit:

r16781:f8f766d0
r17700:7b6d94ef
Show More
dualmode_cellinsert.js
42 lines | 1.9 KiB | application/javascript | JavascriptLexer
/ IPython / html / tests / notebook / dualmode_cellinsert.js
Jonathan Frederic
Cleaned up test names and locations.
r15936
// Test
casper.notebook_test(function () {
var a = 'print("a")';
var index = this.append_cell(a);
this.execute_cell_then(index);
var b = 'print("b")';
index = this.append_cell(b);
this.execute_cell_then(index);
var c = 'print("c")';
index = this.append_cell(c);
this.execute_cell_then(index);
this.then(function () {
// Cell insertion
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');
Paul Ivanov
add tests for cell_type preserving insertion
r16781 this.test.assertEquals(this.get_cell(2).cell_type, 'code', 'a; inserts a code cell when on code cell');
Jonathan Frederic
Cleaned up test names and locations.
r15936 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');
Paul Ivanov
add tests for cell_type preserving insertion
r16781 this.test.assertEquals(this.get_cell(3).cell_type, 'code', 'b; inserts a code cell when on code cell');
Jonathan Frederic
Cleaned up test names and locations.
r15936 this.validate_notebook_state('b', 'command', 3);
});
Paul Ivanov
add tests for cell_type preserving insertion
r16781 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);
});
});