Skip to content

Fix for number 0 treated as invalid in hover #1

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

Merged
merged 2 commits into from
May 30, 2018

Conversation

dalle
Copy link
Owner

@dalle dalle commented May 29, 2018

Fixes plotly#2660.

expect(hoverTrace.pointNumber).toEqual(17);
expect(hoverTrace.x).toEqual(0.388);
expect(hoverTrace.y).toEqual(1);
expect(hoverTrace.text).toEqual(0);

Choose a reason for hiding this comment

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

I see you're faithfully mimicking the previous test, but I'd prefer toBe instead of toEqual - lately I use toBe whenever possible, which I think includes all of these cases - especially for the 0, since some values we would find unacceptable would pass, like '' == 0, whereas toBe is stricter.

@alexcjohnson
Copy link

@dalle this looks great! Just a small comment, then feel free to open the PR against the main repo. Thanks!

@dalle dalle merged commit 1113e33 into master May 30, 2018
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