Skip to content

test(canvas): test text bbox calculator on real canvas#153

Merged
markov00 merged 4 commits intoelastic:masterfrom
markov00:fix-canvas-on-tests
Apr 8, 2019
Merged

test(canvas): test text bbox calculator on real canvas#153
markov00 merged 4 commits intoelastic:masterfrom
markov00:fix-canvas-on-tests

Conversation

@markov00
Copy link
Copy Markdown
Collaborator

@markov00 markov00 commented Apr 5, 2019

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 strikethroughs to 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
  • Unit tests were updated or added to match the most common scenarios
  • Each commit follows the convention

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
@markov00 markov00 added :axis Axis related issue bug Something isn't working labels Apr 5, 2019
@markov00 markov00 requested a review from emmacunningham April 5, 2019 14:16
Copy link
Copy Markdown
Contributor

@emmacunningham emmacunningham left a comment

Choose a reason for hiding this comment

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

tested locally 👍 and code LGTM

markov00 added 3 commits April 5, 2019 19:05
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-io
Copy link
Copy Markdown

Codecov Report

Merging #153 into master will increase coverage by 0.04%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
src/state/chart_state.ts 95.89% <100%> (+0.05%) ⬆️
src/lib/axes/canvas_text_bbox_calculator.ts 100% <100%> (ø) ⬆️
src/lib/utils/domain.ts 100% <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 77a352c...37e2a0c. Read the comment docs.

@markov00 markov00 merged commit f25ef46 into elastic:master Apr 8, 2019
@markov00
Copy link
Copy Markdown
Collaborator Author

markov00 commented Apr 8, 2019

🎉 This PR is included in version 3.7.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@markov00 markov00 added the released Issue released publicly label Apr 8, 2019
@markov00 markov00 mentioned this pull request Apr 8, 2019
1 task
@markov00 markov00 deleted the fix-canvas-on-tests branch April 16, 2019 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:axis Axis related issue bug Something isn't working released Issue released publicly

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Partial displayed labels on axis

3 participants