-
Notifications
You must be signed in to change notification settings - Fork 46
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
🐛 Add missing tests and miscellaneous fixes #611
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Robdel12
approved these changes
Jul 21, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🏁 Pretty uncharacteristic for us to miss coverage like this but very happy to have this SDK back up to 100%.
channel.emit('updateGlobals', { globals: {} }); | ||
channel.emit('setCurrentStory', { storyId: story.id }); | ||
channel.emit('updateQueryParams', { ...story.queryParams }); | ||
channel.emit('updateGlobals', { globals: story.globals }); | ||
channel.emit('updateStoryArgs', { storyId: story.id, updatedArgs: story.args }); | ||
|
||
// resolve when rendered, reject on any other renderer event | ||
return new Promise((resolve, reject) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Slicccckk
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is this?
With #592, it was discovered that this SDK was actually missing quite a bit of tests. Since it was out of scope for that PR, we opted to address this in another PR (this PR).
With the addition of new tests to achieve 100% coverage, a few small bugs inevitably came up and were fixed.
When splitting snapshots into shards with
--shard-count
, providing the--partial
flag will now always set the parallel total environment variable to-1
unless already set. Previously, the--shard-count
flag did not consider the--partial
flag when setting the environment variable.When creating the story URL and settings params with the native URLSearchParams API, it will encode any provided values. However, args and globals params are already encoded, therefore resulting in double encoding of those params. This was fixed with string concatenation for already encoded values, while still using the URLSearchParams API for provided query params.
Both the
storybook
andstorybook:start
commands have similar try-catch blocks to start Percy and call the same utility function with a differentbaseUrl
. The try-catch repetition was moved into the utility function which now accepts a callback that is called during thefinally
block.The
deferUploads
option was changed to the newdelayUploads
option so snapshots get sent to the API as soon as possible rather than all at once at the end of the process. Uploads are still delayed rather than be left eager so empty builds are not created when failing to find any snapshots or Storybook build.A new event listener was added to the end of story navigation, which will wait until Storybook emits a
storyRendered
event before taking a snapshot. While network idle is always awaited on, this might help in situations when no network requests occur, which may cause the snapshot to be taken too early when no other wait options are provided.