mirror of
https://github.com/jupyter/notebook.git
synced 2025-03-01 12:56:54 +08:00
test quick dirty and under pressure
This commit is contained in:
parent
aefbdbf365
commit
94d057bf10
@ -65,6 +65,44 @@ casper.notebook_test(function () {
|
||||
this.test.assert(cell_outputs_cleared.every(function(cell_output_state) {
|
||||
return cell_output_state == "";
|
||||
}), "ensure that all cells are cleared");
|
||||
|
||||
|
||||
/**
|
||||
* Test the multiselection 2 moves down.
|
||||
**/
|
||||
var result_indices = this.evaluate( function() {
|
||||
Jupyter.notebook.select(0);
|
||||
Jupyter.notebook.extend_selection_by(2);
|
||||
var indices = Jupyter.notebook.get_selected_cells_indices();
|
||||
Jupyter.notebook.move_selection_down();
|
||||
Jupyter.notebook.move_selection_down();
|
||||
return Jupyter.notebook.get_selected_cells_indices();
|
||||
});
|
||||
var result = [2,3,4].entries();
|
||||
this.test.assert(result_indices.every( function(i){ return i === result.next().value[1];}))
|
||||
|
||||
/**
|
||||
* Test the multiselection move up at beginning of a Notebook
|
||||
**/
|
||||
this.test.assert(this.evaluate( function() {
|
||||
Jupyter.notebook.select(0);
|
||||
Jupyter.notebook.extend_selection_by(2);
|
||||
var indices_it = Jupyter.notebook.get_selected_cells_indices().entries();
|
||||
Jupyter.notebook.move_selection_up();
|
||||
var result = Jupyter.notebook.get_selected_cells_indices();
|
||||
return result.every( function(i){return i === indices_it.next().value[1];})
|
||||
}));
|
||||
|
||||
/**
|
||||
* Test the move down at the end of the notebook
|
||||
**/
|
||||
this.test.assert(this.evaluate( function() {
|
||||
var last_index = Jupyter.notebook.get_cells().length
|
||||
Jupyter.notebook.select(last_index - 3);
|
||||
Jupyter.notebook.extend_selection_by(2);
|
||||
var indices.it() = Jupyter.notebook.get_selected_cells_indices().entries();
|
||||
Jupyter.notebook.move_selection_down();
|
||||
var result = Jupyter.notebook.get_selected_cells_indices();
|
||||
return result.every( function(i){return i === indices_it.next().value[1];})
|
||||
}));
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user