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

How to test canvas drawing? #8

Open
pobch opened this issue Apr 10, 2022 · 2 comments
Open

How to test canvas drawing? #8

pobch opened this issue Apr 10, 2022 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@pobch
Copy link
Owner

pobch commented Apr 10, 2022

Possible approaches

  • Image snapshot in Jest. Maybe convert the result canvas to an image and compare it to the previous snapshot.
  • Image snapshot in Cypress. This could be slow to run.
  • Sync elementsSnapshot from component's state to a global variable (window). Then, expect against the global variable. This can check if raw data for drawing is correct, but it's not cover the result of drawing.
@pobch pobch added the help wanted Extra attention is needed label Apr 10, 2022
@pobch
Copy link
Owner Author

pobch commented Apr 25, 2022

Let's try Cypress first. Jest may not be suitable for stuff related to layout, reason: testing-library/user-event#440 (comment)

@pobch pobch removed the help wanted Extra attention is needed label May 4, 2022
@pobch pobch changed the title How to test canvas drawing? Imp: Test canvas drawing May 4, 2022
@pobch pobch changed the title Imp: Test canvas drawing Add tests for canvas drawing May 19, 2022
@pobch pobch added the improvement Refactor, re-organize, code quality label May 19, 2022
@pobch pobch changed the title Add tests for canvas drawing How to test canvas drawing Oct 15, 2022
@pobch pobch changed the title How to test canvas drawing How to test canvas drawing? Oct 15, 2022
@pobch pobch added documentation Improvements or additions to documentation and removed improvement Refactor, re-organize, code quality labels Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant