##// END OF EJS Templates
move pyout/execute_result and pyerr/error transforms to to/fromJSON...
move pyout/execute_result and pyerr/error transforms to to/fromJSON like the mime-type maps

File last commit:

r15949:d0ec96bd
r16589:f6285f13
Show More
merge_cells_api.js
43 lines | 1.3 KiB | application/javascript | JavascriptLexer
David Wyde
Add CasperJS tests for `merge_cell_above()` and `merge_cell_below()`.
r13256 //
// Test merging two notebook cells.
//
Paul Ivanov
pep8 style function names
r13275 casper.notebook_test(function() {
Jonathan Frederic
Final fixes?
r15941 var that = this;
Jonathan Frederic
Call trigger_keydown in merge_cells_api test
r15943 var set_cells_text = function () {
that.evaluate(function() {
David Wyde
Add CasperJS tests for `merge_cell_above()` and `merge_cell_below()`.
r13256 var cell_one = IPython.notebook.get_selected_cell();
cell_one.set_text('a = 5');
Jonathan Frederic
Call trigger_keydown in merge_cells_api test
r15943 });
that.trigger_keydown('b');
Jonathan Frederic
Final fixes?
r15941
Jonathan Frederic
Call trigger_keydown in merge_cells_api test
r15943 that.evaluate(function() {
David Wyde
Add CasperJS tests for `merge_cell_above()` and `merge_cell_below()`.
r13256 var cell_two = IPython.notebook.get_selected_cell();
Thomas Kluyver
Use Python 3 compatible syntax in tests
r13278 cell_two.set_text('print(a)');
Jonathan Frederic
Call trigger_keydown in merge_cells_api test
r15943 });
};
this.evaluate(function () {
IPython.notebook.command_mode();
});
David Wyde
Add CasperJS tests for `merge_cell_above()` and `merge_cell_below()`.
r13256
Jonathan Frederic
Call trigger_keydown in merge_cells_api test
r15943 // merge_cell_above()
Jonathan Frederic
s/set_cell_text/set_cells_text
r15948 set_cells_text();
Jonathan Frederic
Call trigger_keydown in merge_cells_api test
r15943 var output_above = this.evaluate(function () {
David Wyde
Add CasperJS tests for `merge_cell_above()` and `merge_cell_below()`.
r13256 IPython.notebook.merge_cell_above();
Jonathan Frederic
get_text() before returning results
r15949 return IPython.notebook.get_selected_cell().get_text();
Jonathan Frederic
Call trigger_keydown in merge_cells_api test
r15943 });
David Wyde
Add CasperJS tests for `merge_cell_above()` and `merge_cell_below()`.
r13256
Jonathan Frederic
Call trigger_keydown in merge_cells_api test
r15943 // merge_cell_below()
Jonathan Frederic
s/set_cell_text/set_cells_text
r15948 set_cells_text();
Jonathan Frederic
Call trigger_keydown in merge_cells_api test
r15943 var output_below = this.evaluate(function() {
David Wyde
Add CasperJS tests for `merge_cell_above()` and `merge_cell_below()`.
r13256 IPython.notebook.select(0);
IPython.notebook.merge_cell_below();
Jonathan Frederic
get_text() before returning results
r15949 return IPython.notebook.get_selected_cell().get_text();
David Wyde
Add CasperJS tests for `merge_cell_above()` and `merge_cell_below()`.
r13256 });
Jonathan Frederic
Call trigger_keydown in merge_cells_api test
r15943 this.test.assertEquals(output_above, 'a = 5\nprint(a)',
Brian E. Granger
Fixing more JS tests.
r14081 'Successful merge_cell_above().');
Jonathan Frederic
Call trigger_keydown in merge_cells_api test
r15943 this.test.assertEquals(output_below, 'a = 5\nprint(a)',
Brian E. Granger
Fixing more JS tests.
r14081 'Successful merge_cell_below().');
David Wyde
Add CasperJS tests for `merge_cell_above()` and `merge_cell_below()`.
r13256 });