Add Open Notebook Folder functionality to Books viewlet. (#9939)

This commit is contained in:
Cory Rivera
2020-04-13 23:42:02 -07:00
committed by GitHub
parent a8cf029633
commit 2b2a275fb0
12 changed files with 224 additions and 74 deletions

View File

@@ -235,10 +235,9 @@ describe('BookTreeViewProviderTests', function () {
});
it('should ignore toc.yml files not in _data folder', async () => {
await bookTreeViewProvider.currentBook.getTableOfContentFiles(rootFolderPath);
for (let p of bookTreeViewProvider.currentBook.tableOfContentPaths) {
should(p.toLocaleLowerCase()).equal(tableOfContentsFile.replace(/\\/g, '/').toLocaleLowerCase());
}
await bookTreeViewProvider.currentBook.loadTableOfContentFiles(rootFolderPath);
let path = bookTreeViewProvider.currentBook.tableOfContentsPath;
should(path.toLocaleLowerCase()).equal(tableOfContentsFile.replace(/\\/g, '/').toLocaleLowerCase());
});
this.afterAll(async function (): Promise<void> {

View File

@@ -53,6 +53,7 @@ describe('BookTrustManagerTests', function () {
// Mock Book Data
let bookTreeItemFormat1: BookTreeItemFormat = {
contentPath: undefined,
root: '/temp/SubFolder/',
tableOfContents: {
sections: [
@@ -72,6 +73,7 @@ describe('BookTrustManagerTests', function () {
};
let bookTreeItemFormat2: BookTreeItemFormat = {
contentPath: undefined,
root: '/temp/SubFolder2/',
tableOfContents: {
sections: [
@@ -88,6 +90,7 @@ describe('BookTrustManagerTests', function () {
};
let bookTreeItemFormat3: BookTreeItemFormat = {
contentPath: undefined,
root: '/temp2/SubFolder3/',
tableOfContents: {
sections: [
@@ -206,6 +209,7 @@ describe('BookTrustManagerTests', function () {
apiWrapperMock.setup(api => api.getWorkspaceFolders()).returns(() => []);
apiWrapperMock.setup(api => api.getConfiguration(TypeMoq.It.isValue(constants.notebookConfigKey))).returns(() => workspaceConfigurtionMock.object);
let bookTreeItemFormat1: BookTreeItemFormat = {
contentPath: undefined,
root: '/temp/SubFolder/',
tableOfContents: {
sections: [
@@ -225,6 +229,7 @@ describe('BookTrustManagerTests', function () {
};
let bookTreeItemFormat2: BookTreeItemFormat = {
contentPath: undefined,
root: '/temp/SubFolder2/',
tableOfContents: {
sections: [