##// END OF EJS Templates
Backport PR #5488: Added missing require and jquery from cdn....
Backport PR #5488: Added missing require and jquery from cdn. For some reason (I suppose some changes at the css level) the font size inside the input cells was fixed at 14 px... making the fonts really small in the reveal slideshows. This is really annoying... As a plus, I have also added the missing calls for require and jquery (as the full html template does). I think these fixes belong to 2.0, but I also know we are on the edge... so I hope to get it inside :wink: Cheers.

File last commit:

r15201:029ac024
r16230:ba262623
Show More
widget_container.js
79 lines | 3.0 KiB | application/javascript | JavascriptLexer
Jonathan Frederic
Organized tests.
r14464 // Test container 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 container_index = this.append_cell(
'container = widgets.ContainerWidget()\n' +
Jonathan Frederic
Fixed JS tests to reflect Jason's changes
r14509 'button = widgets.ButtonWidget()\n'+
'container.children = [button]\n'+
Jonathan Frederic
Organized tests.
r14464 'display(container)\n'+
'container.add_class("my-test-class")\n'+
'print("Success")\n');
this.execute_cell_then(container_index, function(index){
MinRK
first review pass on widget tests
r14797 this.test.assertEquals(this.get_output_cell(index).text, 'Success\n',
Jonathan Frederic
Organized tests.
r14464 'Create container 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 .widget-container'),
'Widget container exists.');
this.test.assert(this.cell_element_exists(index,
'.widget-area .widget-subarea .my-test-class'),
'add_class works.');
this.test.assert(this.cell_element_exists(index,
'.widget-area .widget-subarea .my-test-class button'),
'Container parent/child relationship works.');
});
index = this.append_cell(
Jonathan Frederic
Fixed JS tests to reflect Jason's changes
r14509 'container.set_css("float", "right")\n'+
Jonathan Frederic
Organized tests.
r14464 'print("Success")\n');
this.execute_cell_then(index, function(index){
MinRK
first review pass on widget tests
r14797 this.test.assertEquals(this.get_output_cell(index).text, 'Success\n',
Jonathan Frederic
Organized tests.
r14464 'Set container class CSS cell executed with correct output.');
Jonathan Frederic
Fixed JS tests to reflect Jason's changes
r14509
Jonathan Frederic
Organized tests.
r14464 this.test.assert(this.cell_element_function(container_index,
Jonathan Frederic
Fixed JS tests to reflect Jason's changes
r14509 '.widget-area .widget-subarea .my-test-class', 'css', ['float'])=='right',
Jonathan Frederic
Organized tests.
r14464 'set_css works.');
});
index = this.append_cell(
'container.remove_class("my-test-class")\n'+
'print("Success")\n');
this.execute_cell_then(index, function(index){
MinRK
first review pass on widget tests
r14797 this.test.assertEquals(this.get_output_cell(index).text, 'Success\n',
Jonathan Frederic
Organized tests.
r14464 'Remove container class cell executed with correct output.');
this.test.assert(! this.cell_element_exists(container_index,
'.widget-area .widget-subarea .my-test-class'),
'remove_class works.');
});
index = this.append_cell(
'display(button)\n'+
'print("Success")\n');
this.execute_cell_then(index, function(index){
MinRK
first review pass on widget tests
r14797 this.test.assertEquals(this.get_output_cell(index).text, 'Success\n',
Jonathan Frederic
Organized tests.
r14464 'Display container child executed with correct output.');
this.test.assert(! this.cell_element_exists(index,
'.widget-area .widget-subarea .widget-container'),
'Parent container not displayed.');
this.test.assert(this.cell_element_exists(index,
'.widget-area .widget-subarea button'),
'Child displayed.');
});
});