##// END OF EJS Templates
Add a test to demonstrate errors when up/down arrow keys are...
David Wyde -
Show More
@@ -0,0 +1,31
1 //
2 // Check for errors with up and down arrow presses in an empty notebook.
3 //
4 casper.openNewNotebook();
5
6 casper.then(function () {
7 var result = this.evaluate(function() {
8 var ncells = IPython.notebook.ncells(),
9 i;
10
11 // Delete all cells.
12 for (i = 0; i < ncells; i++) {
13 IPython.notebook.delete_cell();
14 }
15
16 // Simulate the "up arrow" and "down arrow" keys.
17 var up_press = jQuery.Event("keydown", {which: 38});
18 $(document).trigger(up_press);
19 var down_press = jQuery.Event("keydown", {which: 40});
20 $(document).trigger(down_press);
21 return true;
22 });
23 casper.test.assertTrue(result, 'Trivial assertion to check for JS errors');
24 });
25
26 casper.deleteCurrentNotebook();
27
28 // Run the browser automation.
29 casper.run(function() {
30 this.test.done();
31 });
General Comments 0
You need to be logged in to leave comments. Login now