Skip to content
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

test(storybook): fix component stories #29245

Merged
merged 3 commits into from
Jun 14, 2024

Conversation

msyavuz
Copy link
Contributor

@msyavuz msyavuz commented Jun 13, 2024

test(storybook): Fix component story controls

SUMMARY

Storybook controls for some components were not working. This pr aims to fix that.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

  1. Run storybook
  2. Check component controls that are previously uninteractable

ADDITIONAL INFORMATION

  • Has associated issue: Storybook controls are out of date #29244
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@dosubot dosubot bot added the change:frontend Requires changing the frontend label Jun 13, 2024
@msyavuz msyavuz changed the title Msyavuz/test/fix component stories test(storybook): fix component stories Jun 13, 2024
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congrats on making your first PR and thank you for contributing to Superset! 🎉 ❤️

We hope to see you in our Slack community too! Not signed up? Use our Slack App to self-register.

@rusackas
Copy link
Member

Fantastic, thanks for digging in here! I'll pull/test as soon as I'm able.

@@ -87,6 +87,7 @@ InteractiveAlert.args = {
InteractiveAlert.argTypes = {
onClose: { action: 'onClose' },
type: {
control: { type: 'select', options: types },
control: { type: 'select' },
options: types,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one doesn't seem to be working still.
image

Copy link
Contributor Author

@msyavuz msyavuz Jun 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one modifies the "type" control, i think it should be working.

@@ -59,7 +59,8 @@ InteractiveDropdownButton.args = {
InteractiveDropdownButton.argTypes = {
placement: {
defaultValue: 'top',
control: { type: 'select', options: PLACEMENTS },
control: { type: 'select' },
options: PLACEMENTS,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably works great, but this thing totally crashes, as it expects to receive only a single child element.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any changes but no crashes either, weird.

},
optionType: {
defaultValue: 'default',
control: { type: 'radio', options: ['default', 'button'] },
control: { type: 'radio' },
options: ['default', 'button'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

THese controls LOOK fine, but the story bombs out with an error of
"Cannot read properties of undefined (reading 'find')"

Note that I know none of this is your fault. We kind of forced the Storybook upgrade through, and it had a lot of unexpected fallout like this.

Copy link
Member

@rusackas rusackas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for all of this. There are still issues with some of these stories and controls, but I know you're inheriting those problems. I think these improvements look good to me, but I'll leave the PR up in case you want to make further enhancements.

@msyavuz
Copy link
Contributor Author

msyavuz commented Jun 14, 2024

Thank you for the review and kind words. If we can merge this it would be great, if the problems are with stories and not component themselves i can open specific PR's for that. For now i think having working controls in storybook improves its usefullness.

@geido geido merged commit 66bd0ce into apache:master Jun 14, 2024
36 of 37 checks passed
@msyavuz msyavuz deleted the msyavuz/test/fix-component-stories branch June 14, 2024 15:48
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 4.1.0 labels Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels change:frontend Requires changing the frontend size/L 🚢 4.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants