Add smoke test for saving a WYSIWYG cell. (#19284)

This commit is contained in:
Cory Rivera
2022-05-04 20:52:22 -07:00
committed by GitHub
parent b3d92aaad3
commit 52782cfebd

View File

@@ -435,6 +435,27 @@ export function setup(opts: minimist.ParsedArgs) {
await app.workbench.sqlNotebook.textCellToolbar.changeTextCellView('Markdown View');
await app.workbench.sqlNotebook.waitForActiveCellEditorContents(s => s.includes('- **_<u><mark>Markdown Test</mark></u>_**'));
});
it('can save and reopen WYSIWYG notebook', async function () {
const app = this.app as Application;
const filename = 'emptyNotebook.ipynb';
await app.workbench.sqlNotebook.openFile(filename);
// Add some text to a WYSIWYG cell and add some basic styling
await app.workbench.sqlNotebook.addCell('markdown');
await app.workbench.sqlNotebook.textCellToolbar.changeTextCellView('Markdown View');
let text = 'WYSIWYG Test';
await app.workbench.sqlNotebook.waitForTypeInEditor(text);
await app.workbench.sqlNotebook.textCellToolbar.changeTextCellView('Rich Text View');
await app.workbench.sqlNotebook.selectAllTextInRichTextEditor();
await app.workbench.sqlNotebook.textCellToolbar.boldSelectedText();
// Save file, close it, and then reopen to verify WYSIWYG cell contents are the same
await app.workbench.quickaccess.runCommand('workbench.action.files.save');
await app.workbench.quickaccess.runCommand('workbench.action.closeActiveEditor');
await app.workbench.sqlNotebook.openFile(filename);
await app.workbench.sqlNotebook.waitForTextCellPreviewContent(text, 'p strong');
});
});
describe('Cell Actions', function () {