Add Notebook Save integration tests (#6103)

* Add Notebook Save integration tests
Wrote test to verify save behavior
Fixed issues found during testing,
specifically around how we notify dirty state change to extensions

* Improved error messages
This commit is contained in:
Kevin Cunnane
2019-06-19 16:09:24 -07:00
committed by GitHub
parent 32313c71e4
commit 47cf496c36
4 changed files with 58 additions and 11 deletions

View File

@@ -37,8 +37,7 @@ export class OutputTypes {
}
export enum NotebookChangeType {
CellsAdded,
CellDeleted,
CellsModified,
CellSourceUpdated,
CellOutputUpdated,
DirtyStateChanged,

View File

@@ -341,7 +341,7 @@ export class NotebookModel extends Disposable implements INotebookModel {
this.updateActiveCell(cell);
this._contentChangedEmitter.fire({
changeType: NotebookChangeType.CellsAdded,
changeType: NotebookChangeType.CellsModified,
cells: [cell],
cellIndex: index
});
@@ -375,9 +375,10 @@ export class NotebookModel extends Disposable implements INotebookModel {
if (index > -1) {
this._cells.splice(index, 1);
this._contentChangedEmitter.fire({
changeType: NotebookChangeType.CellDeleted,
changeType: NotebookChangeType.CellsModified,
cells: [cellModel],
cellIndex: index
cellIndex: index,
isDirty: true
});
} else {
this.notifyError(localize('deleteCellFailed', "Failed to delete cell."));
@@ -401,7 +402,8 @@ export class NotebookModel extends Disposable implements INotebookModel {
this.updateActiveCell(newCells[0]);
}
this._contentChangedEmitter.fire({
changeType: NotebookChangeType.CellsAdded
changeType: NotebookChangeType.CellsModified,
isDirty: true
});
}
}