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 be clamped between 1 and 6', () => {
NotebookActions.setMarkdownHeader(widget, -1);
expect(widget.activeCell.model.value.text.slice(0, 2)).to.equal('# ');
NotebookActions.setMarkdownHeader(widget, 10);
expect(widget.activeCell.model.value.text.slice(0, 7)).to.equal(
'###### '
);
});
it('should be clamped between 1 and 6', () => {
NotebookActions.setMarkdownHeader(widget, -1);
expect(widget.activeCell.model.value.text.slice(0, 2)).to.equal('# ');
NotebookActions.setMarkdownHeader(widget, 10);
expect(widget.activeCell.model.value.text.slice(0, 7)).to.equal(
'###### '
);
});
it('should replace leading white space', () => {
widget.activeCell.model.value.text = ' foo';
NotebookActions.setMarkdownHeader(widget, 2);
expect(widget.activeCell.model.value.text).to.equal('## foo');
});
it('should be a no-op if there is no model', () => {
widget.model = null;
NotebookActions.setMarkdownHeader(widget, 1);
expect(widget.activeCellIndex).to.equal(-1);
});
it('should be a no-op if there is no model', () => {
widget.model = null;
NotebookActions.setMarkdownHeader(widget, 1);
expect(widget.activeCellIndex).to.equal(-1);
});
execute: args => {
const current = getCurrent(args);
if (current) {
return NotebookActions.setMarkdownHeader(current.content, 1);
}
},
isEnabled
execute: args => {
const current = getCurrent(args);
if (current) {
return NotebookActions.setMarkdownHeader(current.notebook, 4);
}
},
isEnabled
execute: args => {
const current = getCurrent(args);
if (current) {
return NotebookActions.setMarkdownHeader(current.content, 4);
}
},
isEnabled
execute: args => {
const current = getCurrent(args);
if (current) {
return NotebookActions.setMarkdownHeader(current.notebook, 4);
}
},
isEnabled
execute: args => {
const current = getCurrent(args);
if (current) {
return NotebookActions.setMarkdownHeader(current.content, 6);
}
},
isEnabled