|
@@ -27,6 +27,12 @@ class TestParent extends Panel implements ForeignHandler.IReceiver {
|
|
|
addCell(cell: CodeCell): void {
|
|
|
this.addWidget(cell);
|
|
|
}
|
|
|
+ createCodeCell(): CodeCell {
|
|
|
+ const contentFactory = NBTestUtils.createCodeCellFactory();
|
|
|
+ const model = new CodeCellModel({});
|
|
|
+ const cell = new CodeCell({ model, rendermime, contentFactory });
|
|
|
+ return cell;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
class TestHandler extends ForeignHandler {
|
|
@@ -64,12 +70,6 @@ class TestHandler extends ForeignHandler {
|
|
|
|
|
|
const rendermime = defaultRenderMime();
|
|
|
|
|
|
-function cellFactory(): CodeCell {
|
|
|
- const contentFactory = NBTestUtils.createCodeCellFactory();
|
|
|
- const model = new CodeCellModel({});
|
|
|
- const cell = new CodeCell({ model, rendermime, contentFactory });
|
|
|
- return cell;
|
|
|
-}
|
|
|
const relevantTypes = [
|
|
|
'execute_input',
|
|
|
'execute_result',
|
|
@@ -99,7 +99,7 @@ describe('@jupyterlab/console', () => {
|
|
|
|
|
|
beforeEach(() => {
|
|
|
const parent = new TestParent();
|
|
|
- handler = new TestHandler({ session, parent, cellFactory });
|
|
|
+ handler = new TestHandler({ session, parent });
|
|
|
});
|
|
|
|
|
|
afterEach(() => {
|
|
@@ -166,8 +166,7 @@ describe('@jupyterlab/console', () => {
|
|
|
const parent = new TestParent();
|
|
|
handler = new TestHandler({
|
|
|
session: handler.session,
|
|
|
- parent,
|
|
|
- cellFactory
|
|
|
+ parent
|
|
|
});
|
|
|
expect(handler.parent).to.equal(parent);
|
|
|
});
|