Test content manager (#9942)

* Add tests

* Address comments, will add more tests on next PR
This commit is contained in:
Barbara Valdez
2020-04-27 10:59:52 -07:00
committed by GitHub
parent 53c726459e
commit 8370a24f8c

View File

@@ -131,4 +131,12 @@ suite('Local Content Manager', function (): void {
let displayOutput = <nb.IDisplayData>notebook.cells[0].outputs[0];
assert.equal(displayOutput.data['text/html'], '<div></div>');
});
test('Should create a new empty notebook if content is undefined', async function (): Promise<void> {
// verify that when loading content from an empty string or undefined, a new notebook is created.
let content = await contentManager.loadFromContentString('');
assert.equal(content.cells.length, 0);
content = await contentManager.loadFromContentString(undefined);
assert.equal(content.cells.length, 0);
});
});