Jason Grout hace 6 años
padre
commit
337541f1e5
Se han modificado 1 ficheros con 11 adiciones y 1 borrados
  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 {