-
Notifications
You must be signed in to change notification settings - Fork 85
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
refactor(batch-selection): ts conversion - FE-4767 #5654
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 4d9ea4f:
|
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
function renderBatchSelection( | ||
props: Omit<BatchSelectionProps, "children">, | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
renderer: any = mount |
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.
annoying that you have to find this any
, but I can't find another good solution either. I guess we can live with it in a test suite (especially as we're going to move away from Enzyme anyway!). (Even typeof mount | typeof shallow
doesn't work - TS seems to think you can't call that!)
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.
Yep, I spent some time trying to figure it out but then decided that it's not really worth it considering it's a spec file and as you said we'll be getting rid of enzyme anyawy
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.
one solution is to just remove the snapshot and not use shallow at all (we already have Chromatic for that). It will be removed anyway with our conversion to RTL.
export const Light = Themed.bind({}); | ||
Light.args = { | ||
selectedCount: 2, | ||
colorTheme: "light", | ||
}; |
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'm not sure why, but some of the onAction
props in this example are being rendered as noRefCheck()
which may be confusing. It seems modifying the story to not use args
fixes the issue? I'm not sure why the first IconButton
's onAction
prop is being displayed correctly though.
This seems to be the case with the other stories using the Template.bind({})
pattern as well.
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.
That's weird I found an issue in Storybook github repo related to this - storybookjs/storybook#17701
It seems that it has already been fixed, but will be released in v7
storybookjs/storybook#19004
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.
Thanks for sharing this @mkrds 👍🏼 Its good to know this has been addressed by the storybook team.
As the release date for Storybook 7.0 doesn't seem to have been announced yet - what do you think about modifying the stories to not use the Template.bind()
pattern in the meantime?
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.
Sure thing @Parsium, fixed :)
172a40e
to
371ebf1
Compare
78dd6bc
to
e534e43
Compare
00d4374
🎉 This PR is included in version 112.0.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Proposed behaviour
This PR contains BatchSelection component TS conversion
Checklist
d.ts
file added or updated if requiredQA
Additional context
Testing instructions
Full regression testing of BatchSelection is recommended