Fix debounce issue when book toc is updated (#14392)

* pass function to debounce

* remove debounce decorator and move watch methods to bookmodel

* Move the vscode tree change data event to book model

* address pr comments

* fix book tests
This commit is contained in:
Barbara Valdez
2021-02-24 14:24:50 -08:00
committed by GitHub
parent 48c456709e
commit 3d5ff25d13
4 changed files with 41 additions and 50 deletions

View File

@@ -485,14 +485,14 @@ describe('BooksTreeViewTests', function () {
if (run.it === 'v1') {
it('should ignore toc.yml files not in _data folder', async () => {
await bookTreeViewProvider.currentBook.readBookStructure(rootFolderPath);
await bookTreeViewProvider.currentBook.readBookStructure();
await bookTreeViewProvider.currentBook.loadTableOfContentFiles();
let path = bookTreeViewProvider.currentBook.tableOfContentsPath;
should(vscode.Uri.file(path).fsPath).equal(vscode.Uri.file(run.folderPaths.tableOfContentsFile).fsPath);
});
} else if (run.it === 'v2') {
it('should ignore toc.yml files not under the root book folder', async () => {
await bookTreeViewProvider.currentBook.readBookStructure(rootFolderPath);
await bookTreeViewProvider.currentBook.readBookStructure();
await bookTreeViewProvider.currentBook.loadTableOfContentFiles();
let path = bookTreeViewProvider.currentBook.tableOfContentsPath;
should(vscode.Uri.file(path).fsPath).equal(vscode.Uri.file(run.folderPaths.tableOfContentsFile).fsPath);