mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-21 04:10:17 +08:00
Added test to check initial states of bool views
This commit is contained in:
parent
e2143d5a8f
commit
9a15dca291
@ -81,7 +81,7 @@ casper.notebook_test(function () {
|
|||||||
|
|
||||||
// Test bool widget ////////////////////////////////////////////////////////
|
// Test bool widget ////////////////////////////////////////////////////////
|
||||||
var bool_index = this.append_cell(
|
var bool_index = this.append_cell(
|
||||||
'bool_widget = widgets.BoolWidget(description="Title")\n' +
|
'bool_widget = widgets.BoolWidget(description="Title", value=True)\n' +
|
||||||
'display(bool_widget)\n'+
|
'display(bool_widget)\n'+
|
||||||
'display(bool_widget, view_name="ToggleButtonView")\n' +
|
'display(bool_widget, view_name="ToggleButtonView")\n' +
|
||||||
'print("Success")');
|
'print("Success")');
|
||||||
@ -99,6 +99,10 @@ casper.notebook_test(function () {
|
|||||||
'.widget-area .widget-subarea .widget-hbox-single input'),
|
'.widget-area .widget-subarea .widget-hbox-single input'),
|
||||||
'Checkbox exists.');
|
'Checkbox exists.');
|
||||||
|
|
||||||
|
this.test.assert(this.cell_element_function(index,
|
||||||
|
'.widget-area .widget-subarea .widget-hbox-single input', 'val')==true,
|
||||||
|
'Checkbox is checked.');
|
||||||
|
|
||||||
this.test.assert(this.cell_element_exists(index,
|
this.test.assert(this.cell_element_exists(index,
|
||||||
'.widget-area .widget-subarea .widget-hbox-single .widget-hlabel'),
|
'.widget-area .widget-subarea .widget-hbox-single .widget-hlabel'),
|
||||||
'Checkbox label exists.');
|
'Checkbox label exists.');
|
||||||
@ -115,6 +119,10 @@ casper.notebook_test(function () {
|
|||||||
'.widget-area .widget-subarea div button', 'html')=="Title",
|
'.widget-area .widget-subarea div button', 'html')=="Title",
|
||||||
'Toggle button labeled correctly.');
|
'Toggle button labeled correctly.');
|
||||||
|
|
||||||
|
this.test.assert(this.cell_element_function(index,
|
||||||
|
'.widget-area .widget-subarea div button', 'hasClass', ['active']),
|
||||||
|
'Toggle button is toggled.');
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Test button widget //////////////////////////////////////////////////////
|
// Test button widget //////////////////////////////////////////////////////
|
||||||
|
Loading…
Reference in New Issue
Block a user