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

Use strict equality in action logger #1144

Merged
merged 1 commit into from
May 28, 2017

Conversation

raciat
Copy link
Contributor

@raciat raciat commented May 28, 2017

When comparing 0 and empty string (''), action logger doesn't see the difference. See storybook-eol/storybook-addon-actions#33.

Steps to reproduce the issue:

  • Log action with data: 0
  • [0] is logged in
  • Log action with data: ''
  • [0] is logged in

What I did

Added strict equality to distinguish 0 from an empty string ('').

How to test

Use action logger with 0 and then with an empty string ('') and check if both were logged in correctly.

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.

Great catch! Thanks for the fix and your contribution to Storybook!!!

@codecov
Copy link

codecov bot commented May 28, 2017

Codecov Report

Merging #1144 into master will not change coverage.
The diff coverage is 0%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1144   +/-   ##
=======================================
  Coverage   12.75%   12.75%           
=======================================
  Files         199      199           
  Lines        4571     4571           
  Branches      724      724           
=======================================
  Hits          583      583           
  Misses       3347     3347           
  Partials      641      641
Impacted Files Coverage Δ
...ddons/actions/src/containers/ActionLogger/index.js 0% <0%> (ø) ⬆️

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 641a30d...8b9e730. Read the comment docs.

@shilman shilman merged commit 0b48659 into storybookjs:master May 28, 2017
@shilman shilman added the bug label May 28, 2017
@raciat
Copy link
Contributor Author

raciat commented May 28, 2017

Great catch! Thanks for the fix and your contribution to Storybook!!!

No problem. Happy to contribute to such great piece of software! :)

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

Successfully merging this pull request may close these issues.

2 participants