##// END OF EJS Templates
Backport PR #8000: Fix rename issues in dashboard...
Backport PR #8000: Fix rename issues in dashboard - Do not display the full path of the selected item in the text box (**warning** : this removes the possibility of moving a file/folder using the rename dialog. Maybe someone finds this helpful) - Adapt dialog for files and notebook. - Do not allow renaming a running notebook (currently, renaming a running notebook would result in duplication instead of renaming after the open notebook saves/autosaves using the old name)

File last commit:

r20397:ae55f08d
r20876:86af759b
Show More
widget_button.js
48 lines | 1.9 KiB | application/javascript | JavascriptLexer
// Test widget button class
casper.notebook_test(function () {
var button_index = this.append_cell(
'from IPython.html import widgets\n' +
'from IPython.display import display, clear_output\n' +
'button = widgets.Button(description="Title")\n' +
'display(button)\n' +
'print("Success")\n' +
'def handle_click(sender):\n' +
' display("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.');
});
// Wait for the widgets to actually display.
var widget_button_selector = '.widget-area .widget-subarea button';
this.wait_for_element(button_index, widget_button_selector);
// Continue with the tests.
this.then(function() {
this.test.assert(this.cell_element_exists(button_index,
'.widget-area .widget-subarea'),
'Widget subarea exists.');
this.test.assert(this.cell_element_exists(button_index,
widget_button_selector),
'Widget button exists.');
this.test.assert(this.cell_element_function(button_index,
widget_button_selector, 'html')=='<i class="fa"></i>Title',
'Set button description.');
this.cell_element_function(button_index,
widget_button_selector, 'click');
});
this.wait_for_output(button_index, 1);
this.then(function () {
var warning_text = this.get_output_cell(button_index, 1).text;
this.test.assertNotEquals(warning_text.indexOf('Warning'), -1,
'Importing widgets show a warning');
this.test.assertEquals(this.get_output_cell(button_index, 2).data['text/plain'], "'Clicked'",
'Button click event fires.');
});
});