##// END OF EJS Templates
Added test to check initial states of bool views
Jonathan Frederic -
Show More
@@ -81,7 +81,7 b' casper.notebook_test(function () {'
81
81
82 // Test bool widget ////////////////////////////////////////////////////////
82 // Test bool widget ////////////////////////////////////////////////////////
83 var bool_index = this.append_cell(
83 var bool_index = this.append_cell(
84 'bool_widget = widgets.BoolWidget(description="Title")\n' +
84 'bool_widget = widgets.BoolWidget(description="Title", value=True)\n' +
85 'display(bool_widget)\n'+
85 'display(bool_widget)\n'+
86 'display(bool_widget, view_name="ToggleButtonView")\n' +
86 'display(bool_widget, view_name="ToggleButtonView")\n' +
87 'print("Success")');
87 'print("Success")');
@@ -99,6 +99,10 b' casper.notebook_test(function () {'
99 '.widget-area .widget-subarea .widget-hbox-single input'),
99 '.widget-area .widget-subarea .widget-hbox-single input'),
100 'Checkbox exists.');
100 'Checkbox exists.');
101
101
102 this.test.assert(this.cell_element_function(index,
103 '.widget-area .widget-subarea .widget-hbox-single input', 'val')==true,
104 'Checkbox is checked.');
105
102 this.test.assert(this.cell_element_exists(index,
106 this.test.assert(this.cell_element_exists(index,
103 '.widget-area .widget-subarea .widget-hbox-single .widget-hlabel'),
107 '.widget-area .widget-subarea .widget-hbox-single .widget-hlabel'),
104 'Checkbox label exists.');
108 'Checkbox label exists.');
@@ -115,6 +119,10 b' casper.notebook_test(function () {'
115 '.widget-area .widget-subarea div button', 'html')=="Title",
119 '.widget-area .widget-subarea div button', 'html')=="Title",
116 'Toggle button labeled correctly.');
120 'Toggle button labeled correctly.');
117
121
122 this.test.assert(this.cell_element_function(index,
123 '.widget-area .widget-subarea div button', 'hasClass', ['active']),
124 'Toggle button is toggled.');
125
118 });
126 });
119
127
120 // Test button widget //////////////////////////////////////////////////////
128 // Test button widget //////////////////////////////////////////////////////
General Comments 0
You need to be logged in to leave comments. Login now