|
@@ -54,14 +54,14 @@ describe('@jupyterlab/notebook', () => {
|
|
|
});
|
|
|
|
|
|
it('should initialize the model state', async () => {
|
|
|
- const panel = createNotebookPanel(context);
|
|
|
- const model = panel.content.model;
|
|
|
- expect(model).to.be(context.model);
|
|
|
- model.fromJSON(DEFAULT_CONTENT);
|
|
|
- expect(model.cells.canUndo).to.be(true);
|
|
|
+ context.model.fromJSON(DEFAULT_CONTENT);
|
|
|
await context.initialize(true);
|
|
|
await context.ready;
|
|
|
- expect(model.cells.canUndo).to.be(false);
|
|
|
+ expect(context.model.cells.canUndo).to.be(true);
|
|
|
+ const panel = createNotebookPanel(context);
|
|
|
+ expect(panel.content.model).to.be(context.model);
|
|
|
+ // Model state is reset, including the undo history.
|
|
|
+ expect(panel.content.model.cells.canUndo).to.be(false);
|
|
|
});
|
|
|
|
|
|
it('should change notebook to edit mode if we have a single empty code cell', async () => {
|