Fix book toc manager tests (#16034)

* fix book toc manager tests

* add js-yaml to notebooks package.json
This commit is contained in:
Barbara Valdez
2021-07-08 11:51:08 -07:00
committed by GitHub
parent 922348b846
commit 74cfac39d2
4 changed files with 30 additions and 4 deletions

View File

@@ -89,7 +89,7 @@ export function convertTo(version: string, section: JupyterBookSection): Jupyter
temp.external = section.external;
temp.sections = [];
for (let s of section.sections) {
const child = this.convertTo(version, s);
const child = convertTo(version, s);
temp.sections.push(child);
}
return temp;
@@ -120,7 +120,7 @@ export function convertTo(version: string, section: JupyterBookSection): Jupyter
temp.url = section.url;
temp.sections = [];
for (let s of section.sections) {
const child = this.convertTo(version, s);
const child = convertTo(version, s);
temp.sections.push(child);
}
return temp;

View File

@@ -459,7 +459,7 @@ describe('BookTocManagerTests', function () {
});
it.skip('Add section to book', async () => { // TODO: chgagnon Fix from vscode merge
it('Add section to book', async () => {
bookTocManager = new BookTocManager(sourceBookModel, targetBookModel);
await bookTocManager.updateBook(sectionA, targetBook, undefined);
const listFiles = await fs.promises.readdir(path.join(run.targetBook.bookContentFolderPath, 'sectionA'));
@@ -468,7 +468,7 @@ describe('BookTocManagerTests', function () {
should(JSON.stringify(listFiles)).be.equal(JSON.stringify(['notebook1.ipynb', 'notebook2.ipynb', 'readme.md']), 'The files of the section should be moved to the target book folder');
});
it.skip('Add section to section', async () => { // TODO: chgagnon Fix from vscode merge
it('Add section to section', async () => {
bookTocManager = new BookTocManager(sourceBookModel, targetBookModel);
await bookTocManager.updateBook(sectionB, sectionC, {
'title': 'Notebook 6',