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 create a notebook widget', () => {
const widget = new StaticNotebook(options);
expect(widget).to.be.an.instanceof(StaticNotebook);
});
it('should create a `CodeCell`', () => {
const contentFactory = new StaticNotebook.ContentFactory();
const model = new CodeCellModel({});
const codeOptions = { model, rendermime, contentFactory };
const parent = new StaticNotebook(options);
const widget = contentFactory.createCodeCell(codeOptions, parent);
expect(widget).to.be.an.instanceof(CodeCell);
});
});
it('should be emitted when the model changes', () => {
const widget = new StaticNotebook(options);
const model = new NotebookModel();
let called = false;
widget.modelChanged.connect((sender, args) => {
expect(sender).to.equal(widget);
expect(args).to.be.undefined;
called = true;
});
widget.model = model;
expect(called).to.equal(true);
});
});
it('should create a `RawCell`', () => {
const contentFactory = new StaticNotebook.ContentFactory();
const model = new RawCellModel({});
const rawOptions = { model, contentFactory };
const parent = new StaticNotebook(options);
const widget = contentFactory.createRawCell(rawOptions, parent);
expect(widget).to.be.an.instanceof(RawCell);
});
});
it('should get the mime type for code cells', () => {
const widget = new StaticNotebook(options);
expect(widget.codeMimetype).to.equal('text/plain');
});
it('should be the rendermime instance used by the widget', () => {
const widget = new StaticNotebook(options);
expect(widget.rendermime).to.equal(rendermime);
});
});
it('should be the rendermime instance used by the widget', () => {
const widget = new StaticNotebook(options);
expect(widget.rendermime).to.equal(rendermime);
});
});
it('should accept an optional editor config', () => {
const widget = new StaticNotebook(options);
expect(widget.editorConfig).to.equal(editorConfig);
});
});
it('should add the `jp-Notebook` class', () => {
const widget = new StaticNotebook(options);
expect(widget.hasClass('jp-Notebook')).to.equal(true);
});
it('should accept an optional render', () => {
const widget = new StaticNotebook(options);
expect(widget.contentFactory).to.equal(contentFactory);
});