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

Improved error checking in global addDecorator #1481

Merged
merged 2 commits into from
Jul 22, 2017

Conversation

mattleff
Copy link
Contributor

@mattleff mattleff commented Jul 17, 2017

Throw on adding a global decorator after stories have already been added. The global decorator will not be applied.

Issue: #877, #879

What I did

Modified the global addDecorator to throw if stories have already been added. This helps avoid issues like #877 and #879.

How to test

yarn test

mattleff and others added 2 commits July 17, 2017 10:15
Throw on adding a global decorator after stories have already been added. The global decorator will not be applied.
@codecov
Copy link

codecov bot commented Jul 19, 2017

Codecov Report

Merging #1481 into master will increase coverage by 0.07%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1481      +/-   ##
==========================================
+ Coverage   14.54%   14.61%   +0.07%     
==========================================
  Files         202      202              
  Lines        4649     4653       +4     
  Branches      494      501       +7     
==========================================
+ Hits          676      680       +4     
+ Misses       3554     3539      -15     
- Partials      419      434      +15
Impacted Files Coverage Δ
app/react/src/client/preview/client_api.js 42.04% <100%> (+2.75%) ⬆️
...react-native/src/manager/components/PreviewHelp.js 0% <0%> (ø) ⬆️
lib/ui/src/modules/ui/configs/handle_keyevents.js 33.33% <0%> (ø) ⬆️
addons/knobs/src/components/types/Select.js 7.81% <0%> (ø) ⬆️
addons/info/src/components/PropVal.js 0% <0%> (ø) ⬆️
app/react/src/server/config.js 0% <0%> (ø) ⬆️
app/react/src/client/preview/config_api.js 0% <0%> (ø) ⬆️
lib/ui/src/modules/ui/components/layout/usplit.js 38.7% <0%> (ø) ⬆️
app/react/src/client/preview/reducer.js 0% <0%> (ø) ⬆️
.../ui/src/modules/ui/components/left_panel/header.js 28.57% <0%> (ø) ⬆️
... and 24 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 251c563...66f2546. Read the comment docs.

Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

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

Awesome! Thanks for getting this fixed up! 🎖

@shilman shilman merged commit 31255e5 into storybookjs:master Jul 22, 2017
@mattleff mattleff deleted the fixes-877 branch July 24, 2017 16:07
@shilman shilman changed the title Fixes #877, #879 Throw an error in addDecorator if stories have already been added Jul 27, 2017
@shilman shilman changed the title Throw an error in addDecorator if stories have already been added Improved error checking in global addDecorator Jul 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants