|
@@ -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 {
|