-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
dependency: Update jQuery to latest #30345
Conversation
BREAKING: remove the patch that was preventing width/height calculation changes
cypress Run #58112
Run Properties:
|
Project |
cypress
|
Branch Review |
remove-jquery-patch
|
Run status |
Passed #58112
|
Run duration | 21m 25s |
Commit |
c73de3dee5: Move changelog entry to 4.0
|
Committer | Jennifer Shehane |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
6
|
Pending |
1327
|
Skipped |
0
|
Passing |
29364
|
View all changes introduced in this branch ↗︎ |
UI Coverage
46.24%
|
|
---|---|
Untested elements |
188
|
Tested elements |
166
|
Accessibility
92.55%
|
|
---|---|
Failed rules |
3 critical
8 serious
2 moderate
2 minor
|
Failed elements |
897
|
…ypress into remove-jquery-patch
…Query is moving away from sizzle
@@ -1419,29 +1419,45 @@ find.matches = function( expr, elements ) { | ||
}; | ||
|
||
find.matchesSelector = function( elem, expr ) { |
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.
This change is essentially the same as below except instead of setting $.find.support.matchesSelector
to false
to force find
being called, we now just directly check isUsingFocus
to force the same behavior.
cy.findByTestId('playground-selector').clear() | ||
cy.findByTestId('playground-selector').type('[data-cy-root]') |
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.
just fixing chaining of a test that was found to match our recommendations
// if not a sizzle or jQuery error, ignore it and let $el be null | ||
if (!(sizzleRe.test(err.stack) || jQueryRe.test(err.stack))) throw err |
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.
jQuery no longer relies so much on sizzle, so these stack traces changed and are coming from jQuery now.
// width or height of DOM in pixels | ||
this.scrollableContainerWidthHeight = 500 | ||
this.elementWidthHeight = 100 | ||
this.scrollBarWidthHeight = 15 | ||
|
||
// divide by 2 to get the center | ||
// browsers round up the pixel value so we need to round it | ||
this.halfScrollPixels = Math.round((500 - 100) / 2) | ||
this.halfScroll = Math.round((this.scrollableContainerWidthHeight - this.elementWidthHeight) / 2) | ||
this.fullScroll = Math.round(this.scrollableContainerWidthHeight - this.elementWidthHeight) |
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.
Just cleaning this up to make these arbitrary numbers more understandable.
@@ -168,7 +168,7 @@ describe('src/cypress/dom/visibility', () => { | |||
} | |||
|
|||
// ensure all tests run against a scrollable window | |||
const scrollThisIntoView = add('<div style=`height: 1000px;` /><div>Should be in view</div>') | |||
const scrollThisIntoView = add('<div style=`height: 1000px;`></div><div>Should be in view</div>') |
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.
jQuery no longer gracefully handles DOM that is not valid - so this would no longer create the accurate DOM to test against. This was just written wrong at some point.
-function getWidthOrHeight( elem, dimension, extra ) { | ||
+function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { | ||
+function augmentWidthOrHeight( elem, dimension, extra, isBorderBox, styles ) { |
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.
Putting the old width/height patch back into 3.7.1 code
Additional details
Keeping the width/height patch we intended originally to remove
Bumping jQuery
This PR bumps jQuery to 3.7.1 which is latest. 4.0.0 of jQuery is still in Beta.
$.find.support.matchesSelector
is no longer available to set starting in jQuery 3.7.0. Instead, this logic was moved to a patch that now directly usesisUsingFocus
to force the same behavior as before.Steps to test
All tests should pass
How has the user experience changed?
PR Tasks
cypress-documentation
?type definitions
?