mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-13 17:22:15 -05:00
Add smoke tests for cell toolbar keyboard shortcuts. (#19208)
This commit is contained in:
@@ -187,6 +187,19 @@ export function setup(opts: minimist.ParsedArgs) {
|
||||
}
|
||||
}
|
||||
|
||||
async function verifyToolbarKeyboardShortcut(app: Application, keyboardShortcut: string, selector: string) {
|
||||
await app.workbench.sqlNotebook.newUntitledNotebook();
|
||||
await app.workbench.sqlNotebook.addCellFromPlaceholder('Markdown');
|
||||
await app.workbench.sqlNotebook.waitForPlaceholderGone();
|
||||
await app.workbench.sqlNotebook.textCellToolbar.changeTextCellView('Markdown View');
|
||||
let testText = 'Markdown Keyboard Shortcut Test';
|
||||
await app.workbench.sqlNotebook.waitForTypeInEditor(testText);
|
||||
await app.workbench.sqlNotebook.selectAllTextInEditor();
|
||||
await app.code.dispatchKeybinding(keyboardShortcut);
|
||||
await app.code.dispatchKeybinding('escape');
|
||||
await app.workbench.sqlNotebook.waitForTextCellPreviewContent(testText, selector);
|
||||
}
|
||||
|
||||
it('can bold selected text', async function () {
|
||||
const app = this.app as Application;
|
||||
await verifyCellToolbarBehavior(app, () => app.workbench.sqlNotebook.textCellToolbar.boldSelectedText(), 'p strong');
|
||||
@@ -317,6 +330,31 @@ export function setup(opts: minimist.ParsedArgs) {
|
||||
await app.code.dispatchKeybinding('escape');
|
||||
await app.workbench.sqlNotebook.waitForTextCellPreviewContent(sampleLabel, `p a[href="${sampleAddress}"]`);
|
||||
});
|
||||
|
||||
it('can bold text with keyboard shortcut', async function () {
|
||||
const app = this.app as Application;
|
||||
await verifyToolbarKeyboardShortcut(app, app.workbench.sqlNotebook.ctrlOrCmd + '+b', 'p strong');
|
||||
});
|
||||
|
||||
it('can italicize text with keyboard shortcut', async function () {
|
||||
const app = this.app as Application;
|
||||
await verifyToolbarKeyboardShortcut(app, app.workbench.sqlNotebook.ctrlOrCmd + '+i', 'p em');
|
||||
});
|
||||
|
||||
it('can underline text with keyboard shortcut', async function () {
|
||||
const app = this.app as Application;
|
||||
await verifyToolbarKeyboardShortcut(app, app.workbench.sqlNotebook.ctrlOrCmd + '+u', 'p u');
|
||||
});
|
||||
|
||||
it('can highlight text with keyboard shortcut', async function () {
|
||||
const app = this.app as Application;
|
||||
await verifyToolbarKeyboardShortcut(app, app.workbench.sqlNotebook.ctrlOrCmd + '+shift+h', 'p mark');
|
||||
});
|
||||
|
||||
it('can codify text with keyboard shortcut', async function () {
|
||||
const app = this.app as Application;
|
||||
await verifyToolbarKeyboardShortcut(app, app.workbench.sqlNotebook.ctrlOrCmd + '+shift+k', 'pre code');
|
||||
});
|
||||
});
|
||||
|
||||
describe('markdown', function () {
|
||||
|
||||
Reference in New Issue
Block a user