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 settable', () => {
const factory = createFactory();
const newConfig = { ...NBTestUtils.defaultEditorConfig };
factory.editorConfig = newConfig;
expect(factory.editorConfig).to.equal(newConfig);
});
});
function createFactory(
toolbarFactory?: (widget: NotebookPanel) => DocumentRegistry.IToolbarItem[]
): NotebookWidgetFactory {
return new NotebookWidgetFactory({
name: 'notebook',
fileTypes: ['notebook'],
rendermime,
toolbarFactory,
contentFactory,
mimeTypeService: NBTestUtils.mimeTypeService,
editorConfig: NBTestUtils.defaultEditorConfig
});
}
RawCell,
Cell
} from '@jupyterlab/cells';
import { INotebookModel, NotebookModel } from '@jupyterlab/notebook';
import { Notebook, StaticNotebook } from '@jupyterlab/notebook';
import {
NBTestUtils,
framePromise,
signalToPromise
} from '@jupyterlab/testutils';
const contentFactory = NBTestUtils.createNotebookFactory();
const editorConfig = NBTestUtils.defaultEditorConfig;
const rendermime = NBTestUtils.defaultRenderMime();
const options: Notebook.IOptions = {
rendermime,
contentFactory,
mimeTypeService: NBTestUtils.mimeTypeService,
editorConfig
};
function createWidget(): LogStaticNotebook {
const model = new NotebookModel();
const widget = new LogStaticNotebook(options);
widget.model = model;
return widget;
}
RawCell,
Cell
} from '@jupyterlab/cells';
import { INotebookModel, NotebookModel } from '@jupyterlab/notebook';
import { Notebook, StaticNotebook } from '@jupyterlab/notebook';
import {
NBTestUtils,
framePromise,
signalToPromise
} from '@jupyterlab/testutils';
const contentFactory = NBTestUtils.createNotebookFactory();
const editorConfig = NBTestUtils.defaultEditorConfig;
const rendermime = NBTestUtils.defaultRenderMime();
const options: Notebook.IOptions = {
rendermime,
contentFactory,
mimeTypeService: NBTestUtils.mimeTypeService,
editorConfig
};
function createWidget(): LogStaticNotebook {
const model = new NotebookModel();
const widget = new LogStaticNotebook(options);
widget.model = model;
return widget;
}