##// END OF EJS Templates
Merge pull request #5372 from minrk/no-close-strings...
Merge pull request #5372 from minrk/no-close-strings Don't autoclose strings, because CodeMirror's behavior makes it confusing and awkward to type triple-quoted strings (and these are very common in Python). An issue about this was filed in CodeMirror itself: https://github.com/marijnh/CodeMirror/issues/2385

File last commit:

r15201:029ac024
r15843:9c1c7a7e merge
Show More
widget_button.js
42 lines | 1.5 KiB | application/javascript | JavascriptLexer
// Test widget button class
casper.notebook_test(function () {
index = this.append_cell(
'from IPython.html import widgets\n' +
'from IPython.display import display, clear_output\n' +
'print("Success")');
this.execute_cell_then(index);
var button_index = this.append_cell(
'button = widgets.ButtonWidget(description="Title")\n' +
'display(button)\n'+
'print("Success")\n' +
'def handle_click(sender):\n' +
' print("Clicked")\n' +
'button.on_click(handle_click)');
this.execute_cell_then(button_index, function(index){
this.test.assertEquals(this.get_output_cell(index).text, 'Success\n',
'Create button cell executed with correct output.');
this.test.assert(this.cell_element_exists(index,
'.widget-area .widget-subarea'),
'Widget subarea exists.');
this.test.assert(this.cell_element_exists(index,
'.widget-area .widget-subarea button'),
'Widget button exists.');
this.test.assert(this.cell_element_function(index,
'.widget-area .widget-subarea button', 'html')=='Title',
'Set button description.');
this.cell_element_function(index,
'.widget-area .widget-subarea button', 'click');
});
this.wait_for_output(button_index, 1);
this.then(function () {
this.test.assertEquals(this.get_output_cell(button_index, 1).text, 'Clicked\n',
'Button click event fires.');
});
});