test(canvas): test text bbox calculator on real canvas#153
Merged
markov00 merged 4 commits intoelastic:masterfrom Apr 8, 2019
Merged
test(canvas): test text bbox calculator on real canvas#153markov00 merged 4 commits intoelastic:masterfrom
markov00 merged 4 commits intoelastic:masterfrom
Conversation
Removed the jest-canvas-mock package that doesn't use any canvas implementation, substitute the existing test environment with jsdom 14 and updated canvas. Removed an old mock of getContext. Increased the scale font size for the bbox calculaor and configured few tests for that. This commit also revisit the chart_state test suite decupling each test from eachother. fix elastic#152
emmacunningham
approved these changes
Apr 5, 2019
Contributor
emmacunningham
left a comment
There was a problem hiding this comment.
tested locally 👍 and code LGTM
Canvas on node depends on the os, installed library, fonts etc. This commit checks for a maximum difference between the expected value of the measured text of 1px.
Codecov Report
@@ Coverage Diff @@
## master #153 +/- ##
==========================================
+ Coverage 94.03% 94.08% +0.04%
==========================================
Files 34 34
Lines 1744 1758 +14
Branches 219 223 +4
==========================================
+ Hits 1640 1654 +14
Misses 90 90
Partials 14 14
Continue to review full report at Codecov.
|
Collaborator
Author
|
🎉 This PR is included in version 3.7.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Removed the jest-canvas-mock package that doesn't use any canvas implementation, substitute the
existing test environment with jsdom 14 and updated canvas.
Removed an old mock of getContext inside the enzime setup.
Increased the scale font size for the bbox calculator and configured few tests for that, to fix the relative issue on chrome.
This commit also revisit the chart_state test suite decoupling each test from each other.
fix #152
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.[ ] This was checked for cross-browser compatibility, including a check against IE11[ ] Proper documentation or storybook story was added for features that require explanation or tutorials