Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replacing quickpick selection simulation with stubs rather than using… #467

Merged
merged 1 commit into from
Nov 29, 2021

Conversation

gracegoo-stripe
Copy link
Contributor

@gracegoo-stripe gracegoo-stripe commented Nov 29, 2021

… sleeps

The sample selection process requires a lot of user inputs, the first 4 of which are quick pick selections. Originally, we kicked off the sample creation then a series of sleeps and a command to select the first item in the quick pick. However, this ends up in race conditions sometimes where we went up getting to the selection command before the quick pick setup is completed or where we end up moving on before the select command is reached. Rather than use timers like this, I updated the test to stub out each call of the quickpick command to return the results we expect. The onCall API of stubs allows us to return different results based on the order it's called.

Example: https://github.com/stripe/vscode-stripe/runs/4360497244?check_suite_focus=true

Getting client  //This is logged from the runtime code when we call the prompt

client quick pick items: html,react  //This is logged from runtime code when we call the showQuickPick API

seleted client undefined // This is logged from the runtime code when the prompt returns

selecting client //This is logged from the simulateSelectAll function. 

@gracegoo-stripe gracegoo-stripe merged commit 2ddd149 into master Nov 29, 2021
@gracegoo-stripe gracegoo-stripe deleted the gracegoo-stub-individual-quickpick-items branch November 29, 2021 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants