You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.1 KiB
38 lines
1.1 KiB
// Copyright (c) Jupyter Development Team.
|
|
// Distributed under the terms of the Modified BSD License.
|
|
|
|
import { ClassicShell } from '@jupyterlab-classic/application';
|
|
|
|
import { JupyterFrontEnd } from '@jupyterlab/application';
|
|
|
|
import { toArray } from '@lumino/algorithm';
|
|
|
|
import { Widget } from '@lumino/widgets';
|
|
|
|
describe('Shell', () => {
|
|
describe('#constructor()', () => {
|
|
it('should create a LabShell instance', () => {
|
|
const shell = new ClassicShell();
|
|
expect(shell).toBeInstanceOf(ClassicShell);
|
|
});
|
|
});
|
|
|
|
describe('#widgets()', () => {
|
|
it('should add widgets to existing areas', () => {
|
|
const shell = new ClassicShell();
|
|
const widget = new Widget();
|
|
shell.add(widget, 'main');
|
|
const widgets = toArray(shell.widgets('main'));
|
|
expect(widgets).toEqual([widget]);
|
|
});
|
|
|
|
it('should throw an exception if the area does not exist', () => {
|
|
const classicShell = new ClassicShell();
|
|
const shell = classicShell as JupyterFrontEnd.IShell;
|
|
expect(() => {
|
|
shell.widgets('left');
|
|
}).toThrow('Invalid area: left');
|
|
});
|
|
});
|
|
});
|