Browse Source

Update tests

Jason Grout 6 years ago
parent
commit
337541f1e5
1 changed files with 11 additions and 1 deletions
  1. 11 1
      tests/test-console/src/foreign.spec.ts

+ 11 - 1
tests/test-console/src/foreign.spec.ts

@@ -24,15 +24,25 @@ import {
 } from '@jupyterlab/testutils';
 
 class TestParent extends Panel implements ForeignHandler.IReceiver {
-  addCell(cell: CodeCell): void {
+  addCell(cell: CodeCell, msgId?: string): void {
     this.addWidget(cell);
+    if (msgId) {
+      this._cells.set(msgId, cell);
+    }
   }
+
   createCodeCell(): CodeCell {
     const contentFactory = NBTestUtils.createCodeCellFactory();
     const model = new CodeCellModel({});
     const cell = new CodeCell({ model, rendermime, contentFactory });
     return cell;
   }
+
+  getCell(msgId: string) {
+    return this._cells.get(msgId);
+  }
+
+  private _cells = new Map<string, CodeCell>();
 }
 
 class TestHandler extends ForeignHandler {