-
Notifications
You must be signed in to change notification settings - Fork 23
Conversation
Add explicit typings in Toast for Transition for some places? weird
…ki/react-18-upgrade
…ki/react-18-upgrade
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 think PR title would need to be feat
because this is adding react 18 support and also adding a new prop to Toaster.
Also, I think there is something wrong with TS still, because build is failing.
"jest-junit": "^12.0.0", | ||
"jest": "^28.1.0", | ||
"jest-cli": "^28.1.0", | ||
"jest-environment-jsdom": "^28.1.0", |
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.
expect(rows[1].classList).not.toContain('iui-selected'); | ||
expect(rows[2].classList).toContain('iui-selected'); | ||
expect(onSelect).toHaveBeenCalledTimes(2); | ||
expect(onRowClick).toHaveBeenCalledTimes(2); | ||
|
||
userEvent.click(getByText(mockedData()[1].name), { ctrlKey: true }); | ||
const user = userEvent.setup(); |
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.
const mockContainer = mockDocument.querySelector('div') as HTMLDivElement; | ||
|
||
it('should render filter dropdown in the correct document', async () => { | ||
const mockDocument = document.implementation.createHTMLDocument(); |
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 was failing for me before... This helped. I have verified it by getting rid of ownerDocument
in filter and this test started to fail.
@@ -234,15 +234,15 @@ describe('<Wizard />', () => { | |||
|
|||
expect(document.querySelector('.iui-tooltip')).toBeNull(); | |||
expect(screen.queryByText('Step one tooltip')).toBeNull(); | |||
userEvent.hover(screen.getByText('Step One')); | |||
fireEvent.mouseEnter(screen.getByText('Step One'), { bubbles: true }); |
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.
We hover over span, but only parent li
has the popover to trigger tooltip.
userEvent
didnt have (or I didnt find) bubbling option, so used fireEvent
here instead.
Would you mind creating a separate PR? I wanted to, but I saw you have all react 18 changes in there.. |
…ki/react-18-upgrade
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.
Update: I was able to fix the Carousel after playing around some more. It works with all three cases now.
Not sure if we want to make it part of this PR so I pushed it to a separate branch: bd7c8a8Would you mind creating a separate PR? I wanted to, but I saw you have all react 18 changes in there.. Would be nice to merge that before react 18, just to be sure.
Created #683.
…ki/react-18-upgrade
Issue to follow: storybookjs/storybook#18103 |
…ki/react-18-upgrade
…ki/react-18-upgrade
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.
Looks good 👍
Updated to react 18.
Still need to do some testing (with Vite app). I still get warning in there, might be connected that the code has old
render
already, no matter if it is actually called... But on every call it is not shown using this solution, while without it, it shows on every toaster call.Added kinda weird solution to toaster, just I think having it through
setSettings
might not work well, cause this is set globally and need to think of an option to reset it to undefined again.Had this on pre commit hook, so went with
--no-verify
to commitUPDATE:
As I was fighting different issues accidentally ended up upgrading few more libs (only jest and testing-library).
userEvent
ended up having all APIs returning a promise, so.. Needed to go through all and add awaithttps://github.com/testing-library/user-event/releases/tag/v14.0.0
userEvent
@testing-library/react-hooks
, cause now testing-library has all it provided. https://github.com/testing-library/react-hooks-testing-library#a-note-about-react-18-support