mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-09 09:42:34 -05:00
Create book dialog improvements (#14429)
* add improvements TODO on creating book experience * fix create book to support a more complex folder structure * replace \\ to a forward slash on windows * address pr comments * fix tests * use the posix version of path.sep
This commit is contained in:
@@ -58,7 +58,7 @@ describe('BookTocManagerTests', function () {
|
||||
rootFolderPath = path.join(os.tmpdir(), `BookTestData_${uuid.v4()}`);
|
||||
bookFolderPath = path.join(os.tmpdir(), `BookTestData_${uuid.v4()}`);
|
||||
root2FolderPath = path.join(os.tmpdir(), `BookTestData_${uuid.v4()}`);
|
||||
notebooks = ['notebook1.ipynb', 'notebook2.ipynb', 'notebook3.ipynb', 'index.md', 'readme.md'];
|
||||
notebooks = ['notebook1.ipynb', 'notebook2.ipynb', 'notebook3.ipynb', 'index.md'];
|
||||
|
||||
await fs.mkdir(rootFolderPath);
|
||||
await fs.writeFile(path.join(rootFolderPath, notebooks[0]), '');
|
||||
@@ -71,7 +71,7 @@ describe('BookTocManagerTests', function () {
|
||||
await fs.writeFile(path.join(root2FolderPath, notebooks[0]), '');
|
||||
await fs.writeFile(path.join(root2FolderPath, subfolder, notebooks[1]), '');
|
||||
await fs.writeFile(path.join(root2FolderPath, subfolder, notebooks[2]), '');
|
||||
await fs.writeFile(path.join(root2FolderPath, subfolder, notebooks[4]), '');
|
||||
await fs.writeFile(path.join(root2FolderPath, subfolder, notebooks[3]), '');
|
||||
await fs.writeFile(path.join(root2FolderPath, notebooks[3]), '');
|
||||
});
|
||||
|
||||
@@ -94,8 +94,8 @@ describe('BookTocManagerTests', function () {
|
||||
file: path.join(subfolder, 'notebook3')
|
||||
}];
|
||||
await bookTocManager.createBook(bookFolderPath, root2FolderPath);
|
||||
should(equalTOC(bookTocManager.tableofContents[2].sections, expectedSection)).be.true;
|
||||
should((bookTocManager.tableofContents[2] as IJupyterBookSectionV2).file).be.equal(path.join(subfolder, 'readme'));
|
||||
should(equalTOC(bookTocManager.tableofContents[1].sections, expectedSection)).be.true;
|
||||
should(bookTocManager.tableofContents[1].file).be.equal(path.join(path.sep, subfolder, 'index'));
|
||||
});
|
||||
|
||||
it('should ignore invalid file extensions', async () => {
|
||||
|
||||
Reference in New Issue
Block a user