diff --git a/extensions/vscode-api-tests/src/window.test.ts b/extensions/vscode-api-tests/src/window.test.ts index c65d5cbd718..df4b7d080f6 100644 --- a/extensions/vscode-api-tests/src/window.test.ts +++ b/extensions/vscode-api-tests/src/window.test.ts @@ -6,7 +6,7 @@ 'use strict'; import * as assert from 'assert'; -import {workspace, window, ViewColumn, TextEditorViewColumnChangeEvent, Uri, Selection, Position, CancellationTokenSource, TextEditorSelectionChangeKind} from 'vscode'; +import {workspace, window, commands, ViewColumn, TextEditorViewColumnChangeEvent, Uri, Selection, Position, CancellationTokenSource, TextEditorSelectionChangeKind} from 'vscode'; import {join} from 'path'; import {cleanUp, pathEquals} from './utils'; @@ -172,6 +172,22 @@ suite('window namespace tests', () => { }); }); + test('showInputBox - \'\' on Enter', function () { + const p = window.showInputBox(); + return Promise.all([ + commands.executeCommand('workbench.action.acceptSelectedQuickOpenItem'), + p.then(value => assert.equal(value, '')) + ]); + }); + + test('showInputBox - `undefined` on Esc', function () { + const p = window.showInputBox(); + return Promise.all([ + commands.executeCommand('workbench.action.closeQuickOpen'), + p.then(value => assert.equal(value, undefined)) + ]); + }); + test('showQuickPick, undefined on cancel', function () { const source = new CancellationTokenSource(); const p = window.showQuickPick(['eins', 'zwei', 'drei'], undefined, source.token);