-
Notifications
You must be signed in to change notification settings - Fork 39
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
feat: display differentPixels, if available #534
Conversation
6b9556b
to
0217fb0
Compare
if (percent > 1) { | ||
return percentString.slice(0, 4); | ||
} | ||
|
||
return percentString.slice(0, 5); |
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.
This could be written in ternary form, but .slice(0, percent > 1 ? 4 : 5)
is ugly
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.
example values:
- < 0.001% (because 1 pixel out of full hd picture is 0.00004%, which is a lot of digits)
- 10.4% (because we don't need second digit after
.
, if percent > 10 - 5.45% (because in this case second digit could be usefull
- 0.015% (because usually we would see that much of a difference, if it comes to percent values
return <div className={className} onClick={this.onToggleStateResult}>{image.stateName}</div>; | ||
let displayedText = image.stateName; | ||
|
||
if (image.differentPixels && image.diffRatio) { |
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.
Those are absent in proptypes so we dont get errors in case they are not defined
return `< ${percentThreshold}` | ||
} | ||
|
||
return String(percentRounded); |
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.
Wrapped in String()
, so this method only returns string values
31f5984
to
4278c26
Compare
4278c26
to
aeb47d5
Compare
What is done
hermione types fix: gemini-testing/testplane#852