Skip to content

Commit 71a97b5

Browse files
authored
fix quick pick user ordered values test (#5682)
1 parent b7f5c7b commit 71a97b5

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

extension/src/test/suite/util.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,16 @@ const getQuickPickSelectionEvent = (
102102
})
103103
)
104104

105+
const itemsSelected = (
106+
quickPick: NumberQuickPick,
107+
expectedSelectedCount: number
108+
) =>
109+
new Promise(resolve => {
110+
if (quickPick.selectedItems.length === expectedSelectedCount) {
111+
resolve(undefined)
112+
}
113+
})
114+
105115
const toggleQuickPickItem = async (
106116
number: number,
107117
numberInd: number,
@@ -113,7 +123,10 @@ const toggleQuickPickItem = async (
113123
if (itemInd === number) {
114124
const selectionEvent = getQuickPickSelectionEvent(quickPick, numberInd)
115125
await commands.executeCommand('workbench.action.quickPickManyToggle')
116-
await selectionEvent
126+
await Promise.all([
127+
selectionEvent,
128+
itemsSelected(quickPick, numberInd + 1)
129+
])
117130
}
118131
}
119132
}

0 commit comments

Comments
 (0)