From 5e5b54baa41ee161bc96ac028528985fcfcda38c Mon Sep 17 00:00:00 2001 From: Jeremy Tuloup Date: Thu, 4 Feb 2021 21:07:06 +0100 Subject: [PATCH] Change back signature of shell.currentWidget --- packages/application/src/shell.ts | 4 ++-- packages/application/test/shell.spec.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/application/src/shell.ts b/packages/application/src/shell.ts index c43dda2df..a7b7adbad 100644 --- a/packages/application/src/shell.ts +++ b/packages/application/src/shell.ts @@ -85,8 +85,8 @@ export class ClassicShell extends Widget implements JupyterFrontEnd.IShell { /** * The current widget in the shell's main area. */ - get currentWidget(): Widget | null { - return this._main.widgets[0] ?? null; + get currentWidget(): Widget { + return this._main.widgets[0]; } /** diff --git a/packages/application/test/shell.spec.ts b/packages/application/test/shell.spec.ts index 9b991ee5d..53ceaab76 100644 --- a/packages/application/test/shell.spec.ts +++ b/packages/application/test/shell.spec.ts @@ -45,15 +45,15 @@ describe('Shell', () => { describe('#currentWidget', () => { it('should be the current widget in the shell main area', () => { - expect(shell.currentWidget).toBe(null); + expect(shell.currentWidget).toBe(undefined); const widget = new Widget(); widget.node.tabIndex = -1; widget.id = 'foo'; - expect(shell.currentWidget).toBe(null); + expect(shell.currentWidget).toBe(undefined); shell.add(widget, 'main'); expect(shell.currentWidget).toBe(widget); widget.parent = null; - expect(shell.currentWidget).toBe(null); + expect(shell.currentWidget).toBe(undefined); }); });