mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-08 09:08:48 +01:00
tests for undefined vs '', #10640
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import * as assert from 'assert';
|
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 {join} from 'path';
|
||||||
import {cleanUp, pathEquals} from './utils';
|
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 () {
|
test('showQuickPick, undefined on cancel', function () {
|
||||||
const source = new CancellationTokenSource();
|
const source = new CancellationTokenSource();
|
||||||
const p = window.showQuickPick(['eins', 'zwei', 'drei'], undefined, source.token);
|
const p = window.showQuickPick(['eins', 'zwei', 'drei'], undefined, source.token);
|
||||||
|
|||||||
Reference in New Issue
Block a user