it('should initialize the model when the file is saved for the first time', async () => { const context = await createNotebookContext(); context.model.fromJSON(NBTestUtils.DEFAULT_CONTENT); expect(context.model.cells.canUndo).to.equal(true); await context.initialize(true); await context.ready; expect(context.model.cells.canUndo).to.equal(false); });
it('should initialize the model when the file is reverted for the first time', async () => { const context = await createNotebookContext(); await manager.contents.save(context.path, { type: 'notebook', format: 'json', content: NBTestUtils.DEFAULT_CONTENT }); context.model.fromJSON(NBTestUtils.DEFAULT_CONTENT); expect(context.model.cells.canUndo).to.equal(true); await context.initialize(false); await context.ready; expect(context.model.cells.canUndo).to.equal(false); });
beforeEach(async () => { context = await createNotebookContext(); });
beforeEach(async () => { context = await createNotebookContext(); await context.initialize(true); panel = NBTestUtils.createNotebookPanel(context); context.model.fromJSON(NBTestUtils.DEFAULT_CONTENT); });