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 set the dirty flag', () => {
const model = new NotebookModel();
model.dirty = false;
model.fromJSON(NBTestUtils.DEFAULT_CONTENT);
expect(model.dirty).to.equal(true);
});
});
it('should default to an empty string', () => {
let model = new NotebookModel();
expect(model.defaultKernelName).to.be('');
});
it('should default to an empty string', () => {
const model = new NotebookModel();
expect(model.defaultKernelName).to.equal('');
});
});
it('should get the default kernel language of the document', () => {
const model = new NotebookModel();
model.metadata.set('language_info', { name: 'python' });
expect(model.defaultKernelLanguage).to.equal('python');
});
it('should default to an empty string', () => {
let model = new NotebookModel();
expect(model.defaultKernelLanguage).to.be('');
});
it('should serialize the model to JSON', () => {
const model = new NotebookModel();
model.fromJSON(NBTestUtils.DEFAULT_CONTENT);
const data = model.toJSON();
expect(data.cells.length).to.equal(6);
});
});
it('should default to an empty string', () => {
const model = new NotebookModel();
expect(model.defaultKernelLanguage).to.equal('');
});
beforeEach(() => {
widget = new Notebook({
rendermime,
contentFactory: NBTestUtils.createNotebookFactory(),
mimeTypeService: NBTestUtils.mimeTypeService
});
const model = new NotebookModel();
model.fromJSON(NBTestUtils.DEFAULT_CONTENT);
widget.model = model;
widget.activeCellIndex = 0;
});
function createActiveWidget(): LogNotebook {
const model = new NotebookModel();
const widget = new LogNotebook(options);
widget.model = model;
return widget;
}
function createActiveWidget(): LogNotebook {
const model = new NotebookModel();
const widget = new LogNotebook(options);
widget.model = model;
return widget;
}