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

Return empty array when Array knob is empty #1811

Merged

Conversation

gpittarelli
Copy link
Contributor

Issue: #1404

What I did

Made the array knob return an empty array instead of [""] when the input textbox is empty. Also added a test case.

How to test

Run the new test case.

Is this testable with jest or storyshots? jest

Does this need a new example in the kitchen sink apps? nah

Does this need an update to the documentation? probably not...

If your answer is yes to any of these, please make sure to include it in your PR.

@codecov
Copy link

codecov bot commented Sep 7, 2017

Codecov Report

Merging #1811 into release/3.3 will increase coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@               Coverage Diff               @@
##           release/3.3    #1811      +/-   ##
===============================================
+ Coverage         23.3%   23.34%   +0.03%     
===============================================
  Files              277      277              
  Lines             6038     6041       +3     
  Branches           698      698              
===============================================
+ Hits              1407     1410       +3     
- Misses            4132     4140       +8     
+ Partials           499      491       -8
Impacted Files Coverage Δ
addons/knobs/src/components/types/Array.js 84.61% <100%> (+4.61%) ⬆️
addons/info/src/components/types/OneOf.js 14.28% <0%> (ø) ⬆️
lib/ui/src/modules/ui/configs/init_panels.js 25% <0%> (ø) ⬆️
lib/ui/src/modules/ui/containers/addon_panel.js 23.52% <0%> (ø) ⬆️
...ents/stories_panel/stories_tree/tree_decorators.js 34.37% <0%> (ø) ⬆️
lib/components/src/table/cell.js 0% <0%> (ø) ⬆️
app/react/src/client/preview/element_check.js 41.17% <0%> (ø) ⬆️
addons/storyshots/src/require_context.js 45.58% <0%> (ø) ⬆️
lib/ui/src/modules/ui/components/layout/usplit.js 38.7% <0%> (ø) ⬆️
addons/info/src/components/types/PrettyPropType.js 10.2% <0%> (ø) ⬆️
... and 21 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 a88fdf6...09a4f2f. Read the comment docs.

@Hypnosphi Hypnosphi changed the base branch from master to release/3.3 September 7, 2017 11:03
Copy link
Member

@Hypnosphi Hypnosphi left a comment

Choose a reason for hiding this comment

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

Definitely an improvement, thanks!

@Hypnosphi Hypnosphi merged commit ed705f3 into storybookjs:release/3.3 Sep 7, 2017
@gpittarelli gpittarelli deleted the 1404-fix-empty-array-knob branch September 7, 2017 19:25
@Hypnosphi Hypnosphi self-assigned this Sep 19, 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.

2 participants