Skip to content

Commit

Permalink
Clean up strict handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Silvester committed Dec 23, 2019
1 parent 9505ae3 commit 51eada0
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/test-apputils/src/sessioncontext.spec.ts
Expand Up @@ -451,30 +451,30 @@ describe('@jupyterlab/apputils', () => {
describe('#selectKernel()', () => {
it('should select a kernel for the session', async () => {
await sessionContext.initialize();
const session = sessionContext.session;
const session = sessionContext?.session;

const { id, name } = session.kernel;
const accept = acceptDialog();

await sessionContextDialogs.selectKernel(sessionContext);
await accept;

expect(session.kernel.id).to.not.equal(id);
expect(session.kernel.name).to.equal(name);
expect(session.kernel?.id).to.not.equal(id);
expect(session.kernel?.name).to.equal(name);
});

it('should keep the existing kernel if dismissed', async () => {
await sessionContext.initialize();
const session = sessionContext.session;
const session = sessionContext!.session;

const { id, name } = session.kernel;
const dismiss = dismissDialog();

await sessionContextDialogs.selectKernel(sessionContext);
await dismiss;

expect(session.kernel.id).to.equal(id);
expect(session.kernel.name).to.equal(name);
expect(session.kernel?.id).to.equal(id);
expect(session.kernel?.name).to.equal(name);
});
});

Expand All @@ -484,7 +484,7 @@ describe('@jupyterlab/apputils', () => {
find: (_, args) => args === 'restarting'
});
await sessionContext.initialize();
await sessionContext.session?.kernel?.info;
await sessionContext!.session?.kernel?.info;
const restart = sessionContextDialogs.restart(sessionContext);

await acceptDialog();
Expand Down Expand Up @@ -512,7 +512,7 @@ describe('@jupyterlab/apputils', () => {
await sessionContext.initialize();
await sessionContext.shutdown();
await sessionContextDialogs.restart(sessionContext);
expect(sessionContext.session?.kernel).to.be.ok;
expect(sessionContext?.session?.kernel).to.be.ok;
});
});
});
Expand Down

0 comments on commit 51eada0

Please sign in to comment.