-
Notifications
You must be signed in to change notification settings - Fork 47.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
chore: upgrade to jest 25 #17896
chore: upgrade to jest 25 #17896
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit d1c7d66:
|
I can update babel separately and fix the transform errors. EDIT: #17897 |
Bad news: custom css properties are still not working using jsdom |
can use a custom env to get jsdom 16 in, if needed: https://www.npmjs.com/package/jest-environment-jsdom-sixteen |
@SimenB SimenB#837 should include all fixes to make JSDOM happy. @trueadm might want to take a look at the change Drag-Test.internal |
Can you link me to the change you’re referring to? Thanks :) |
packages/react-interactions/events/src/dom/__tests__/Drag-test.internal.js
Outdated
Show resolved
Hide resolved
packages/react-interactions/events/src/dom/__tests__/Drag-test.internal.js
Outdated
Show resolved
Hide resolved
packages/react-interactions/events/src/dom/__tests__/Drag-test.internal.js
Outdated
Show resolved
Hide resolved
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.
The drag tests shouldn't need changing. It suggests something is up with JSDOM if they do? I'll take a deeper look on Monday unless @necolas has any ideas (we haven't touched this code in a while).
As I said it's probably something with JSDOM supporting passive event listeners (see SimenB#837 (comment)) |
Let me look at changing the Drag tests quickly. Maybe that will help. Update: done in #17896 |
packages/react-dom/src/events/__tests__/ChangeEventPlugin-test.internal.js
Show resolved
Hide resolved
It would also be good to know why all the click events were changed from MouseEvents to .click(). Is this another breaking change in JSDOM? |
I took all the time to no only fix it, but prepare a PR, annoate changes and prepare codesandboxes with actual browser behavior. Could you respond to these statements instead? It's not clear if I didn't communicate them well enough or if you just ignored them. |
Yeah it's helpful if the context goes into the PR summary. We don't usually expect context to be found in a PR against another repo. |
@eps1lon Sorry if I wasn't clear. I wasn't criticising your work – this is all awesome! I believe I'm also missing the context to the original code somewhere – I can't see any codesandboxes or comments in this PR? I don't see anything in this PR's summary about any of this. I also wrote the above comment, before your above comments to @necolas, which help expand and clarify on points. |
I updated the PR summary with the relevant context behind the changes |
@@ -432,36 +430,40 @@ describe('ReactDOMServerIntegration', () => { | |||
<div | |||
style={{ | |||
lineClamp: 10, | |||
WebkitLineClamp: 10, |
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.
Not sure why we have this. lineClamp
isn't a valid CSS property...
If you could please rebase this on top of latest master, it looks good to me. |
I won't be at a computer for a few hours, so if you could rebase that'd be sweet. If not I'll get to it later 🙂 |
Never got to it yesterday, but rebased now! 👍 |
Wow this is great, thank you! Leaving for @necolas to merge. |
This reverts commit cf00812. The changes to the test code relate to changes in JSDOM that come with Jest 25: * Several JSDOM workarounds are no longer needed. * Several tests made assertions to match incorrect JSDOM behavior (e.g. setAttribute calls) that JSDOM has now patched to match browsers. * https://codesandbox.io/s/resets-value-of-datetime-input-to-fix-bugs-in-ios-safari-1ppwh * JSDOM no longer triggers default actions when dispatching click events. * https://codesandbox.io/s/beautiful-cdn-ugn8f * JSDOM fixed (jsdom/jsdom#2700) a bug so that calling focus() on an already focused element does not dispatch a FocusEvent. * JSDOM now supports passive events. * JSDOM has improved support for custom CSS properties. * But requires jsdom/cssstyle#112 to land to support webkit prefixed properties.
Heads up, I'm reverting this in #18376 because of a Jest bug that is fixed in master but unreleased: jestjs/jest#9575 |
This reverts commit cf00812. The changes to the test code relate to changes in JSDOM that come with Jest 25: * Several JSDOM workarounds are no longer needed. * Several tests made assertions to match incorrect JSDOM behavior (e.g. setAttribute calls) that JSDOM has now patched to match browsers. * https://codesandbox.io/s/resets-value-of-datetime-input-to-fix-bugs-in-ios-safari-1ppwh * JSDOM no longer triggers default actions when dispatching click events. * https://codesandbox.io/s/beautiful-cdn-ugn8f * JSDOM fixed (jsdom/jsdom#2700) a bug so that calling focus() on an already focused element does not dispatch a FocusEvent. * JSDOM now supports passive events. * JSDOM has improved support for custom CSS properties. * But requires jsdom/cssstyle#112 to land to support webkit prefixed properties.
This reverts commit cf00812. The changes to the test code relate to changes in JSDOM that come with Jest 25: * Several JSDOM workarounds are no longer needed. * Several tests made assertions to match incorrect JSDOM behavior (e.g. setAttribute calls) that JSDOM has now patched to match browsers. * https://codesandbox.io/s/resets-value-of-datetime-input-to-fix-bugs-in-ios-safari-1ppwh * JSDOM no longer triggers default actions when dispatching click events. * https://codesandbox.io/s/beautiful-cdn-ugn8f * JSDOM fixed (jsdom/jsdom#2700) a bug so that calling focus() on an already focused element does not dispatch a FocusEvent. * JSDOM now supports passive events. * JSDOM has improved support for custom CSS properties. * But requires jsdom/cssstyle#112 to land to support webkit prefixed properties.
This reverts commit cf00812. The changes to the test code relate to changes in JSDOM that come with Jest 25: * Several JSDOM workarounds are no longer needed. * Several tests made assertions to match incorrect JSDOM behavior (e.g. setAttribute calls) that JSDOM has now patched to match browsers. * https://codesandbox.io/s/resets-value-of-datetime-input-to-fix-bugs-in-ios-safari-1ppwh * JSDOM no longer triggers default actions when dispatching click events. * https://codesandbox.io/s/beautiful-cdn-ugn8f * JSDOM fixed (jsdom/jsdom#2700) a bug so that calling focus() on an already focused element does not dispatch a FocusEvent. * JSDOM now supports passive events. * JSDOM has improved support for custom CSS properties. * But requires jsdom/cssstyle#112 to land to support webkit prefixed properties.
This reverts commit fc7835c.
Summary
The changes to the test code relate to changes in JSDOM that come with Jest 25:
setAttribute
calls) that JSDOM has now patched to match browsers.focus()
on an already focused element does not dispatch aFocusEvent
.Closes #17012
Test Plan
yarn test