Browse Source

Fix model initialization test.

Jason Grout 7 years ago
parent
commit
ce1abdabe6
1 changed files with 6 additions and 6 deletions
  1. 6 6
      tests/test-notebook/src/panel.spec.ts

+ 6 - 6
tests/test-notebook/src/panel.spec.ts

@@ -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 () => {