mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-22 17:48:56 +01:00
tests for undefined vs '', #10640
This commit is contained in:
@@ -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<any>([
|
||||
commands.executeCommand('workbench.action.acceptSelectedQuickOpenItem'),
|
||||
p.then(value => assert.equal(value, ''))
|
||||
]);
|
||||
});
|
||||
|
||||
test('showInputBox - `undefined` on Esc', function () {
|
||||
const p = window.showInputBox();
|
||||
return Promise.all<any>([
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user