|
@@ -13,7 +13,11 @@ import { NotebookModel } from '@jupyterlab/notebook';
|
|
|
|
|
|
import { ModelDB } from '@jupyterlab/observables';
|
|
|
|
|
|
-import { signalToPromise, NBTestUtils } from '@jupyterlab/testutils';
|
|
|
+import {
|
|
|
+ signalToPromise,
|
|
|
+ NBTestUtils,
|
|
|
+ acceptDialog
|
|
|
+} from '@jupyterlab/testutils';
|
|
|
|
|
|
describe('@jupyterlab/notebook', () => {
|
|
|
describe('NotebookModel', () => {
|
|
@@ -204,6 +208,15 @@ describe('@jupyterlab/notebook', () => {
|
|
|
model.fromJSON(NBTestUtils.DEFAULT_CONTENT);
|
|
|
expect(model.nbformat).to.equal(NBTestUtils.DEFAULT_CONTENT.nbformat);
|
|
|
});
|
|
|
+
|
|
|
+ it('should present a dialog when the format changes', () => {
|
|
|
+ const model = new NotebookModel();
|
|
|
+ const content = { ...NBTestUtils.DEFAULT_CONTENT };
|
|
|
+ content.metadata.orig_nbformat = 1;
|
|
|
+ model.fromJSON(content);
|
|
|
+ expect(model.nbformat).to.equal(nbformat.MAJOR_VERSION);
|
|
|
+ return acceptDialog();
|
|
|
+ });
|
|
|
});
|
|
|
|
|
|
describe('#nbformatMinor', () => {
|