Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should change to command mode', () => {
widget.mode = 'edit';
NotebookActions.cut(widget);
NotebookActions.paste(widget);
expect(widget.mode).to.equal('command');
});
it('should paste cells from a NBTestUtils.clipboard', () => {
const source = widget.activeCell.model.value.text;
const next = widget.widgets[1];
widget.select(next);
const count = widget.widgets.length;
NotebookActions.cut(widget);
widget.activeCellIndex = 1;
NotebookActions.paste(widget);
expect(widget.widgets.length).to.equal(count);
expect(widget.widgets[2].model.value.text).to.equal(source);
expect(widget.activeCellIndex).to.equal(3);
});
execute: args => {
const current = getCurrent(args);
if (current) {
return NotebookActions.paste(current.notebook, 'replace');
}
},
isEnabled
execute: () => NotebookActions.paste(nbWidget.content, 'above')
});
execute: args => {
const current = getCurrent(args);
if (current) {
return NotebookActions.paste(current.notebook, 'below');
}
},
isEnabled
execute: () => NotebookActions.paste(nbWidget.content, 'below')
});
execute: args => {
const current = getCurrent(args);
if (current) {
return NotebookActions.paste(current.content, 'above');
}
},
isEnabled
execute: args => {
const current = getCurrent(args);
if (current) {
return NotebookActions.paste(current.notebook, 'above');
}
},
isEnabled
execute: args => {
const current = getCurrent(args);
if (current) {
const { content } = current;
NotebookActions.paste(content, 'below');
content.mode = 'edit';
}
},
isEnabled
execute: args => {
const current = getCurrent(args);
if (current) {
return NotebookActions.paste(current.notebook);
}
},
isEnabled