Second batch of tests for notebookEditor class (#10999)

* first few notebookEditor tests

* formating fixes

* unstash previous unfinished work

* saving

* PR feedback

* PR feedback

* copyright fixes

* improve test names and assertion messages

* saving

* PR feedback

* improve test names.

* test name change

* test name change

* remove unneeded cast

* remove spurious comment

* fix misplaced paranthesis - thanks hygiene checker!

* remove unused code

* remove deferredPromise

* createEditor test and dispose fixes

* remove unneeded import

* rempve unnecessary mock usage in dispose test

* use getContainer() for ['parent']

* use getContainer for ['parent']

* remove launch.json edits

* notebookService needs 9th constructor argument

* Add uploading debugging step

* minor changes

* remove changes to ci.yml

* working version

* formatting fixes

* pr fixes

* hygiene and exception path fixes

* remove minor debug changes

* pr feedback

* pr feedback

Co-authored-by: Arvind Ranasaria MacPro <arvranmac@MININT-OE7B592.fareast.corp.microsoft.com>
Co-authored-by: chgagnon <chgagnon@microsoft.com>
This commit is contained in:
Arvind Ranasaria
2020-06-24 13:19:12 -07:00
committed by GitHub
parent c62394262a
commit c2ef27cd68
8 changed files with 353 additions and 70 deletions

View File

@@ -17,7 +17,7 @@ export interface INotebookFindModel {
findNext(): Promise<NotebookRange>;
/** find the previous match */
findPrevious(): Promise<NotebookRange>;
/** search the notebook model for the given exp up to maxMatch occurances */
/** search the notebook model for the given exp up to maxMatch occurrences */
find(exp: string, matchCase?: boolean, wholeWord?: boolean, maxMatches?: number): Promise<NotebookRange>;
/** clear the results of the find */
clearFind(): void;

View File

@@ -175,7 +175,7 @@ export class NotebookEditorModel extends EditorModel {
return this.getNotebookModel() !== undefined;
}
public getNotebookModel(): INotebookModel {
public getNotebookModel(): INotebookModel | undefined {
let editor = this.notebookService.findNotebookEditor(this.notebookUri);
if (editor) {
return editor.model;