mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-23 01:58:53 +01:00
make sure to return initial value, #11503
This commit is contained in:
@@ -180,6 +180,14 @@ suite('window namespace tests', () => {
|
||||
]);
|
||||
});
|
||||
|
||||
test('showInputBox - default value on Enter', function () {
|
||||
const p = window.showInputBox({ value: 'farboo' });
|
||||
return Promise.all<any>([
|
||||
p.then(value => assert.equal(value, 'farboo')),
|
||||
commands.executeCommand('workbench.action.acceptSelectedQuickOpenItem'),
|
||||
]);
|
||||
});
|
||||
|
||||
test('showInputBox - `undefined` on Esc', function () {
|
||||
const p = window.showInputBox();
|
||||
return Promise.all<any>([
|
||||
@@ -188,6 +196,15 @@ suite('window namespace tests', () => {
|
||||
]);
|
||||
});
|
||||
|
||||
test('showInputBox - `undefined` on Esc (despite default)', function () {
|
||||
const p = window.showInputBox({ value: 'farboo' });
|
||||
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