Basic test widget button.

This commit is contained in:
Jonathan Frederic 2013-12-03 17:24:25 -08:00 committed by Jonathan Frederic
parent 8e1c52382c
commit 9d8a0f62f1

View File

@ -91,6 +91,27 @@ casper.notebook_test(function () {
this.test.assert(found, python_name + ' exists in javascript');
}
}
// Try to create a button widget
cell_index = run_python_code('button = widgets.ButtonWidget()\n' +
'display(button)\n'+
'print("Success")');
this.then(function () {
// Check if the WidgetManager class is defined.
var $widget_subarea = this.evaluate(function() {
var $cell = IPython.notebook.get_cell_element(cell_index);
return $cell.find('.widget-area.widget-subarea');
});
// Make sure the widget subarea was found.
this.test.assert($widget_subarea.length > 0, 'Create button widget, widget subarea exist?');
var $widget_button = $widget_subarea.find('button');
this.test.assert($$widget_button.length > 0, 'Create button widget, widget button exist?');
}
});