Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should present a dialog if there is no distinct kernel to start', async () => {
// Remove the kernel preference before initializing.
session.kernelPreference = {};
const accept = acceptDialog();
await session.initialize();
await accept;
expect(session.kernel.name).to.equal(manager.specs.default);
});
await manager.contents.save(context.path, {
type: factory.contentType,
format: factory.fileFormat,
content: 'bar'
});
handler.saveInterval = 1;
handler.start();
context.model.fromString('baz');
context.fileChanged.connect(() => {
expect(context.model.toString()).to.equal('baz');
delegate.resolve(undefined);
});
}, 1500);
// Extend the timeout to wait for the dialog because of the setTimeout.
await acceptDialog(document.body, 3000);
await delegate.promise;
});
it('should select a kernel for the session', async () => {
await session.initialize();
const { id, name } = session.kernel;
const accept = acceptDialog();
await session.selectKernel();
await accept;
expect(session.kernel.id).to.not.equal(id);
expect(session.kernel.name).to.equal(name);
});