-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
CLI: replace notes with background in generated examples #11516
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
describe('addon-backgrounds', () => { | ||
before(() => { | ||
cy.visitStorybook(); | ||
}); | ||
|
||
it('should have a dark background', () => { | ||
// click on the button | ||
cy.navigateToStory('button', 'with custom background'); | ||
|
||
cy.getPreviewIframe().should('have.css', 'background-color', 'rgb(51, 51, 51)'); | ||
}); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,18 @@ Emoji.args = { | |
text: '😀 😎 👍 💯', | ||
}; | ||
|
||
Emoji.parameters = { notes: 'My notes on a button with emojis' }; | ||
export const WithCustomBackground = Template.bind({}); | ||
WithCustomBackground.args = { | ||
text: 'Defined via addon-backgrounds!', | ||
}; | ||
|
||
WithCustomBackground.storyName = 'With custom background'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good question, will remove it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @shilman would you like me to remove the same for |
||
|
||
WithCustomBackground.parameters = { | ||
backgrounds: { | ||
default: 'dark', | ||
}, | ||
}; | ||
|
||
export const TextWithAction = () => ({ | ||
component: Button, | ||
|
@@ -35,7 +46,6 @@ export const TextWithAction = () => ({ | |
}); | ||
|
||
TextWithAction.storyName = 'With an action'; | ||
TextWithAction.parameters = { notes: 'My notes on a button with emojis' }; | ||
|
||
export const ButtonWithLinkToAnotherStory = () => ({ | ||
component: Button, | ||
|
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.
How about we just make a story called
Inverse
that:I think this would fit well into the new template. WDYT?
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 love it