diff --git a/src/vs/workbench/contrib/search/browser/searchView.ts b/src/vs/workbench/contrib/search/browser/searchView.ts index baa12121c5d..61e407deeaa 100644 --- a/src/vs/workbench/contrib/search/browser/searchView.ts +++ b/src/vs/workbench/contrib/search/browser/searchView.ts @@ -1543,7 +1543,7 @@ export class SearchView extends ViewPane { if (this.searchConfig.enableSearchEditorPreview) { dom.append(messageEl, $('span', undefined, resultMsg + ' - ')); - const span = dom.append(messageEl, $('span', undefined)); + const span = dom.append(messageEl, $('span')); const openInEditorLink = dom.append(span, $('a.pointer.prominent', undefined, nls.localize('openInEditor.message', "Open in editor"))); openInEditorLink.title = appendKeyBindingLabel( @@ -1556,7 +1556,7 @@ export class SearchView extends ViewPane { })); } else { - dom.append(messageEl, $('p', undefined, resultMsg)); + dom.append(messageEl, $('span', undefined, resultMsg)); } this.reLayout(); } else if (!msgWasHidden) { diff --git a/test/automation/src/search.ts b/test/automation/src/search.ts index 8f7767802f5..91b986038d5 100644 --- a/test/automation/src/search.ts +++ b/test/automation/src/search.ts @@ -109,11 +109,12 @@ export class Search extends Viewlet { } async waitForResultText(text: string): Promise { - await this.code.waitForTextContent(`${VIEWLET} .messages .message>p`, text); + // The label can end with " - " depending on whether the search editor is enabled + await this.code.waitForTextContent(`${VIEWLET} .messages .message>span`, undefined, result => result.startsWith(text)); } async waitForNoResultText(): Promise { - await this.code.waitForElement(`${VIEWLET} .messages[aria-hidden="true"] .message>p`); + await this.code.waitForElement(`${VIEWLET} .messages[aria-hidden="true"] .message>span`); } private async waitForInputFocus(selector: string): Promise {