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

♻️ Migrate stories 54..61 to args #37860

Merged
merged 5 commits into from
Mar 15, 2022

Conversation

rbeckthomas
Copy link
Contributor

Partial for #35923.

args: {
width: '640px',
height: '360px',
ariaLabel: 'Video Player',
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: use aria-label so you don't have to extract it and rename it in the fixtures

Copy link
Contributor Author

Choose a reason for hiding this comment

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

using a hyphen in an arg name gives me a linting error, i dont think i can get around extracting and renaming in this case.

Copy link
Contributor

Choose a reason for hiding this comment

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

you can turn off the rule with an eslint-disable-next-line comment otherwise feel free to merge

};

Default.argTypes = {
amount: {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit/fmi: why do you use args for some and argTypes for others? amount: 1 is equivalent to {name: 'amount', control: {type: 'number'}, defaultValue: 1,}, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep thats correct. The difference is that storybook will infer a control type based on the initial value of the arg and for argTypes we specify the control type. In this case since these would all probably be inferred correctly they really could all be args.

Copy link
Contributor

@kvchari kvchari left a comment

Choose a reason for hiding this comment

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

some (non-blocking) comments

@rbeckthomas rbeckthomas enabled auto-merge (squash) March 15, 2022 02:07
@rbeckthomas rbeckthomas merged commit ffa91f1 into ampproject:main Mar 15, 2022
@ampprojectbot
Copy link
Member

Warning: disparity between this PR Percy build and its main build

The Percy build for this PR was approved (either manually by a member of the AMP team, or automatically if there were no visual diffs). However, during a continuous integration step we generated another Percy build using the commit on the main branch that this PR was merged into, and there appears to be a mismatch between the two.

This is possibly an indication of an issue with this pull request, but could also be the result of flakiness. Please inspect the two builds < This PR's Percy build / main commit's Percy build > and determine further action:

  • If the disparity appears to be caused by this PR, please create an bug report or send out a new PR to fix
  • If the disparity appears to be a flake, please @-mention ampproject/wg-approvers in a comment
  • If there is no disparity and this comment was created by mistake, please @-mention ampproject/wg-infra
  • If unsure, @-mention ampproject/wg-approvers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants