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