QuickInput Proposed API (#49340)

This commit is contained in:
Christof Marti
2018-06-12 18:21:35 +02:00
parent e0ac369bb2
commit 965c1862b5
13 changed files with 1428 additions and 504 deletions

View File

@@ -417,7 +417,7 @@ suite('window namespace tests', () => {
});
});
test('Default value for showInput Box accepted even if fails validateInput, #33691', function () {
test('Default value for showInput Box not accepted when it fails validateInput, reversing #33691', async function () {
const result = window.showInputBox({
validateInput: (value: string) => {
if (!value || value.trim().length === 0) {
@@ -427,19 +427,9 @@ suite('window namespace tests', () => {
}
});
const accept = commands.executeCommand('workbench.action.acceptSelectedQuickOpenItem');
return Promise.race([
result.then(() => assert.ok(false)),
accept.then(() => assert.ok(false), err => assert.ok(err))
.then(() => new Promise(resolve => setTimeout(resolve, 10)))
])
.then(() => {
const close = commands.executeCommand('workbench.action.closeQuickOpen');
return Promise.all([result, close])
.then(([value]) => {
assert.equal(value, undefined);
});
});
await commands.executeCommand('workbench.action.acceptSelectedQuickOpenItem');
await commands.executeCommand('workbench.action.closeQuickOpen');
assert.equal(await result, undefined);
});