From 453f8e5525bb77b2bd09d83e7b352eeb6591a378 Mon Sep 17 00:00:00 2001 From: Cory Rivera Date: Wed, 3 Aug 2022 09:36:24 -0700 Subject: [PATCH] Set cell preview mode when toggling edit mode. (#20220) * Also fix leftover settings changes in markdown smoke test. --- .../contrib/notebook/browser/cellViews/textCell.component.ts | 1 + test/smoke/src/sql/areas/notebook/notebook.test.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/sql/workbench/contrib/notebook/browser/cellViews/textCell.component.ts b/src/sql/workbench/contrib/notebook/browser/cellViews/textCell.component.ts index d65b193fe5..c5ca1830f6 100644 --- a/src/sql/workbench/contrib/notebook/browser/cellViews/textCell.component.ts +++ b/src/sql/workbench/contrib/notebook/browser/cellViews/textCell.component.ts @@ -436,6 +436,7 @@ export class TextCellComponent extends CellView implements OnInit, OnChanges { this.cellModel.showMarkdown = false; } else { this.markdownMode = this.cellModel.showMarkdown; + this.previewMode = this.cellModel.showPreview; } this.updatePreview(); this._changeRef.detectChanges(); diff --git a/test/smoke/src/sql/areas/notebook/notebook.test.ts b/test/smoke/src/sql/areas/notebook/notebook.test.ts index 4b69defa17..9f15dbfd44 100644 --- a/test/smoke/src/sql/areas/notebook/notebook.test.ts +++ b/test/smoke/src/sql/areas/notebook/notebook.test.ts @@ -294,6 +294,7 @@ export function setup(opts: minimist.ParsedArgs) { } await app.workbench.quickaccess.runCommand('workbench.action.revertAndCloseActiveEditor'); } + await app.workbench.settingsEditor.clearUserSettings(); } async function verifyToolbarKeyboardShortcut(app: Application, keyboardShortcut: string, selector: string) { @@ -311,6 +312,7 @@ export function setup(opts: minimist.ParsedArgs) { await app.workbench.sqlNotebook.waitForTextCellPreviewContent(testText, selector); await app.workbench.quickaccess.runCommand('workbench.action.revertAndCloseActiveEditor'); } + await app.workbench.settingsEditor.clearUserSettings(); } it('can bold selected text', async function () {