コード例 #1
0
ファイル: context.spec.ts プロジェクト: AlbertHilb/jupyterlab
 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);
 });
コード例 #2
0
ファイル: context.spec.ts プロジェクト: AlbertHilb/jupyterlab
 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);
 });
コード例 #3
0
 beforeEach(async () => {
   context = await createNotebookContext();
 });
コード例 #4
0
 beforeEach(async () => {
   context = await createNotebookContext();
   await context.initialize(true);
   panel = NBTestUtils.createNotebookPanel(context);
   context.model.fromJSON(NBTestUtils.DEFAULT_CONTENT);
 });