-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[core] Upgrade Node.js to v18 on CircleCI, CodeSandbox and Netlify #9319
[core] Upgrade Node.js to v18 on CircleCI, CodeSandbox and Netlify #9319
Conversation
Netlify deploy previewNetlify deploy preview: https://deploy-preview-9319--material-ui-x.netlify.app/ Updated pagesNo updates. These are the results for the performance tests:
|
@@ -647,7 +647,7 @@ describe('<DateField /> - Editing', () => { | |||
describeAdapters('Pasting', DateField, ({ adapter, render, renderWithProps, clickOnInput }) => { | |||
const firePasteEvent = (input: HTMLInputElement, pastedValue: string) => { | |||
act(() => { | |||
const clipboardEvent = new Event('paste', { | |||
const clipboardEvent = new window.Event('paste', { |
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.
I had to change this because the tests were failing with the following error:
TypeError: Failed to execute 'dispatchEvent' on 'EventTarget': parameter 1 is not of type 'Event'.
I think that the availability of the Event
constructor without the window
prefix can vary depending on the Node.js version and the specific environment setup. Having this ensures that it is created within the jsdom
env, making it compatible with the simulated DOM.
Somewhat related to the discussion in the GitHub issue: jsdom/jsdom#3331.
I also attempted to upgrade to JSDom version 22.1.0
(#8913), but unfortunately, it did not resolve the problem.
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.
It's strange that numerous tests on Data Grid side using new Event('scroll')
pass, but changing this test to new Event('paste')
(without the second argument) still results in failures... 🤷
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.
@LukasTy Those tests are not running on JSDom. They are running only on browser.
if (isJSDOM) {
// Need layouting
this.skip();
}
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.
🤦 I could swear that I did check for this and found at least one without the tests being skipped, before writing the comment...
But anyways, thank you for double-checking. 👌 🙇
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.
Maybe you missed checking the before
hook for that test block 😅
before(function beforeHook() {
if (isJSDOM) {
// Need layouting
this.skip();
}
});
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.
Could be. 🤔
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.
Thank you for looking at this matter and resolving the test failure! 💯 👍
@flaviendelangle do you see any potential problems with the test change? 🤔
@@ -647,7 +647,7 @@ describe('<DateField /> - Editing', () => { | |||
describeAdapters('Pasting', DateField, ({ adapter, render, renderWithProps, clickOnInput }) => { | |||
const firePasteEvent = (input: HTMLInputElement, pastedValue: string) => { | |||
act(() => { | |||
const clipboardEvent = new Event('paste', { | |||
const clipboardEvent = new window.Event('paste', { |
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.
It's strange that numerous tests on Data Grid side using new Event('scroll')
pass, but changing this test to new Event('paste')
(without the second argument) still results in failures... 🤷
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.
Thank you!
Similar to mui/material-ui#37173.