##// END OF EJS Templates
Fixing JS tests.
Brian E. Granger -
Show More
@@ -1,23 +1,24 b''
1 //
1 //
2 // Check for errors with up and down arrow presses in a non-empty notebook.
2 // Check for errors with up and down arrow presses in a non-empty notebook.
3 //
3 //
4 casper.notebook_test(function () {
4 casper.notebook_test(function () {
5 var result = this.evaluate(function() {
5 var result = this.evaluate(function() {
6 IPython.notebook.command_mode();
6 pos0 = IPython.notebook.get_selected_index();
7 pos0 = IPython.notebook.get_selected_index();
7 IPython.notebook.insert_cell_below('code');
8 IPython.utils.press(IPython.keycodes.b)
8 pos1 = IPython.notebook.get_selected_index();
9 pos1 = IPython.notebook.get_selected_index();
9 IPython.notebook.insert_cell_below('code');
10 IPython.utils.press(IPython.keycodes.b)
10 pos2 = IPython.notebook.get_selected_index();
11 pos2 = IPython.notebook.get_selected_index();
11 // Simulate the "up arrow" and "down arrow" keys.
12 // Simulate the "up arrow" and "down arrow" keys.
12 IPython.utils.press_up();
13 IPython.utils.press_up();
13 pos3 = IPython.notebook.get_selected_index();
14 pos3 = IPython.notebook.get_selected_index();
14 IPython.utils.press_down();
15 IPython.utils.press_down();
15 pos4 = IPython.notebook.get_selected_index();
16 pos4 = IPython.notebook.get_selected_index();
16 return pos0 == 0 &&
17 return pos0 == 0 &&
17 pos1 == 1 &&
18 pos1 == 1 &&
18 pos2 == 2 &&
19 pos2 == 2 &&
19 pos3 == 1 &&
20 pos3 == 1 &&
20 pos4 == 2;
21 pos4 == 2;
21 });
22 });
22 this.test.assertTrue(result, 'Up/down arrow okay in non-empty notebook.');
23 this.test.assertTrue(result, 'Up/down arrow okay in non-empty notebook.');
23 });
24 });
General Comments 0
You need to be logged in to leave comments. Login now