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

🐛 Fix enableJavaScript default for snapshot discovery #453

Merged
merged 2 commits into from
Jul 29, 2021

Conversation

wwilsman
Copy link
Contributor

@wwilsman wwilsman commented Jul 29, 2021

What is this?

During the recent discovery/snapshot refactors, the Page class was updated to default enableJavaScript to true for other packages to borrow a page without explicitly enabling it. However, since enableJavaScript did not have a default configuration value for dom snapshots in the Percy class, that resulted in all snapshots defaulting to have javascript enabled during asset discovery (this does not affect the API default).

I also noticed that for snapshot captures, JavaScript is always enabled, even if the config option is false.

I updated this line to always prefer the enableJavaScript option and default based on the presence of domSnapshot. When there is no dom provided, the default should be true, otherwise it should be false. I also added a test so this can be caught in the future if it regresses again.

@wwilsman wwilsman added the 🐛 bug Something isn't working label Jul 29, 2021
@wwilsman wwilsman requested a review from Robdel12 July 29, 2021 16:43
@wwilsman wwilsman enabled auto-merge (squash) July 29, 2021 16:45
Copy link
Contributor

@Robdel12 Robdel12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wwilsman wwilsman disabled auto-merge July 29, 2021 16:48
@wwilsman wwilsman enabled auto-merge (squash) July 29, 2021 17:02
@wwilsman wwilsman merged commit f873ad3 into master Jul 29, 2021
@wwilsman wwilsman deleted the ww/fix-js-discovery-default branch July 29, 2021 17:05
samarsault pushed a commit that referenced this pull request Mar 3, 2023
Bumps [@percy/sdk-utils](https://github.com/percy/cli/tree/HEAD/packages/sdk-utils) from 1.0.0-beta.71 to 1.0.0-beta.73.
- [Release notes](https://github.com/percy/cli/releases)
- [Commits](https://github.com/percy/cli/commits/v1.0.0-beta.73/packages/sdk-utils)

---
updated-dependencies:
- dependency-name: "@percy/sdk-utils"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants