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 split the active cell into two cells', () => {
const cell = widget.activeCell;
const source = 'thisisasamplestringwithnospaces';
cell.model.value.text = source;
const index = widget.activeCellIndex;
const editor = cell.editor;
editor.setCursorPosition(editor.getPositionAt(10));
NotebookActions.splitCell(widget);
const cells = widget.model.cells;
const newSource =
cells.get(index).value.text + cells.get(index + 1).value.text;
expect(newSource).to.equal(source);
});
it('should clear the existing selection', () => {
each(widget.widgets, child => {
widget.select(child);
});
NotebookActions.splitCell(widget);
for (let i = 0; i < widget.widgets.length; i++) {
if (i === widget.activeCellIndex) {
continue;
}
expect(widget.isSelected(widget.widgets[i])).to.equal(false);
}
});
execute: () => NotebookActions.splitCell(nbWidget.content)
});
execute: () => NotebookActions.splitCell(nbWidget.notebook)
});
execute: () => NotebookActions.splitCell(nbWidget.content)
});
execute: () => NotebookActions.splitCell(nbWidget.content)
});
execute: args => {
const current = getCurrent(args);
if (current) {
return NotebookActions.splitCell(current.notebook);
}
},
isEnabled
execute: () => NotebookActions.splitCell(nbWidget.content)
});
execute: args => {
const current = getCurrent(args);
if (current) {
return NotebookActions.splitCell(current.content);
}
},
isEnabled
execute: args => {
const current = getCurrent(args);
if (current) {
return NotebookActions.splitCell(current.notebook);
}
},
isEnabled