-
Notifications
You must be signed in to change notification settings - Fork 28
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
React 18 upgrade #221
React 18 upgrade #221
Conversation
@@ -1,4 +1,5 @@ | |||
import { render, screen } from '@testing-library/react'; | |||
import '@testing-library/jest-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.
Why not importing this in the setup file? So we don't get strange errors if we move tests around
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 tried moving in my previous PR but the TS compiler starts complaining and no matter what I tried it would not satisfy the error.
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.
yeah, that's not ideal, I'd try to move it back to jest.setup.js
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.
Bigger significant changes are needed to the config, and TSConfig is required. Basing this on all the simple changes I tried.
Might be better in another PR as this one already has a lot of changes
@@ -1,4 +1,5 @@ | |||
import { render, screen } from '@testing-library/react'; | |||
import '@testing-library/jest-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.
yeah, that's not ideal, I'd try to move it back to jest.setup.js
@@ -272,16 +265,16 @@ describe('useQueryParam()', () => { | |||
|
|||
const { storeState, actions } = getRouterStore(); | |||
|
|||
actions.push('/projects/123/board/456?foo=hello&bar=world'); | |||
await nextTick(); | |||
act(() => { |
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 wondering, why are you using act
here, are there any async actions under the hood of push()
?
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.
Were not using userEvent
here so we need to manually use act due to waiting for re-renders and or any other background changes.
First pass at React18 upgrade.