chore(snapshots): use default value for cmd line argument#30263
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
brandyscarney
approved these changes
Mar 17, 2025
Member
brandyscarney
left a comment
There was a problem hiding this comment.
Confirmed that this correctly adds or updates screenshots when a component path is passed for:
- A new e2e test
- A new e2e test with updates made after creating the screenshots
- An existing e2e test with significant changes to the component (e.g. changing background color from blue to red)
However, this does not work for:
- An existing e2e test with minor changes to the component (e.g. adjusting a stepped color to the next closest shade):
- I changed the input helper text color from
$text-color-step-300to$text-color-step-400
- I changed the input helper text color from
The only way to detect this type of change would be by using all, but doing so would re-generate screenshots even when no actual visual differences exist for those components. Given this, I'm okay with moving forward with this fix as is. 👍
This file contains hidden or 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
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.
Issue number: N/A
What is the current behavior?
Certain custom commands related to Playwright are failing. Specifically:
npm run test.e2e.update-snapshots ${component}npm run test.e2e.docker.update-snapshots ${component}The failures are due to Playwright v1.50 changing it's accepted values for
update-snapshots. Possible values are "all", "changed", "missing", and "none". By default, it's "all". All snapshots will be updated when no value is passed or a wrong value is passed.Our scripts end up running (doesn't matter if it's local or through the docker):
npx playwright test --update-snapshots ${component}It used to only update the snapshots that have changed. However, with the update, the argument thinks that the component is its value but since it's not an accepted one, it leads to the default.
What is the new behavior?
Set our default value when it comes to updating snapshots. By using
changedthen we would only update snapshots for those tests that have a difference. This aligns with how it used to work before the update.Does this introduce a breaking change?
Other information
N/A