Add a few more notebook model unit tests (#9859)

* Add a few more notebook model tests

* Add tests for nb managers, active cell

* Add assert messages
This commit is contained in:
Chris LaFreniere
2020-04-06 16:39:02 -07:00
committed by GitHub
parent 4c01482a8f
commit 1d22e23c2d
2 changed files with 270 additions and 35 deletions

View File

@@ -396,6 +396,9 @@ export class NotebookModel extends Disposable implements INotebookModel {
let index = firstIndex(this._cells, (cell) => cell.equals(cellModel));
if (index > -1) {
this._cells.splice(index, 1);
if (this._activeCell === cellModel) {
this.updateActiveCell(undefined);
}
this._contentChangedEmitter.fire({
changeType: NotebookChangeType.CellsModified,
cells: [cellModel],
@@ -434,10 +437,6 @@ export class NotebookModel extends Disposable implements INotebookModel {
return this._activeCell;
}
public set activeCell(cell: ICellModel) {
this._activeCell = cell;
}
private notifyError(error: string): void {
this._onErrorEmitter.fire({ message: error, severity: Severity.Error });
}