-
Notifications
You must be signed in to change notification settings - Fork 48
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: always set percy-data attributes when serializing #1450
Closed
Closed
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8e6a3db
fix: always set percy-data attributes when serializing
nilshah98 e41d6dc
wip: tests passing, but order of shadow, plain fixed
nilshah98 8ef8679
wip: use cloned nodes for plain, so that we dont check the reserializ…
nilshah98 dbbdb79
test: remove test for overriding previous guids
nilshah98 d1603e3
chore: lint fix
nilshah98 4047299
test: undo test setup changes
nilshah98 0c15aab
chore: added comments
nilshah98 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
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.
why are we cloning
DOM
here?because our assertions are againts original DOM, if we clone it we're not checking against original DOM when APIs change in future and there is drift between cloned DOM and original DOM.
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.
serializeDOM()
already does that for us.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.
Here is the test preparation workflow that is happening for Chrome -
plain
DOM, and then runserialzeDOM
on it, and store this incache['plain']
serializeDOM
on it again, and store this incache['shadow']
plain
DOM part is getting serialized twice, and since while storing incache['plain']
we store by reference, it get's updated to be the newly serialized plain DOM, whereas the serializedDOM from first iteration is intact.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.
understood, in this case we shouldn't be calling
dom.cloneNode
rather our custom clone node traversal code, will update and merge.