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

Add support for visual diffs in Jest #54668

Closed
joshdover opened this issue Jan 14, 2020 · 7 comments
Closed

Add support for visual diffs in Jest #54668

joshdover opened this issue Jan 14, 2020 · 7 comments
Labels
Feature:Unit Testing Team:Operations Team label for Operations Team

Comments

@joshdover
Copy link
Contributor

joshdover commented Jan 14, 2020

We have unit tests in the repository that do visual diffs / image comparisons of canvas elements (example) inside the Karma browser test environment.

It appears that these tests may be able to be run in jsdom/Jest using jsdom's canvas support.

We should explore using Jest here to further simplify our testing suite, increase performance, and reduce our reliance on Karma.

Related #54339

@joshdover joshdover added the Team:Operations Team label for Operations Team label Jan 14, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-operations (Team:Operations)

@mshustov
Copy link
Contributor

I know that we have Percy for visual tests in FTR. Would it cover the existing needs?

@joshdover
Copy link
Contributor Author

Percy may give more useful feedback on tests, but the downside is requiring the FTR to run these simple image comparison tests.

@flash1293
Copy link
Contributor

I tested this and managed to make it work for both tag cloud and vega visualizations - the src/test_utils/public/image_comparator.js has to be rewritten (A thin layer on top of https://github.com/americanexpress/jest-image-snapshot using the canvas package to turn stuff into pixels would probably be appropriate and easy to use).

However after having a deeper look into these tests, I don't think we require this level of testing right now. Tag cloud renders to svg, canvas is only in the loop here to turn the svg into pixels. Vega does render to canvas directly, but it is also able to render to svg instead (setting exposed via spec). So for the current Kibana app use cases we can also work with just validating the rendered svg.

Summary: It works and would be a good addition for some cases, but for our current use cases it's not strictly required. For Kibana App team more of a nice-to-have feature.

@jbudz jbudz mentioned this issue Aug 17, 2020
10 tasks
@tylersmalley tylersmalley added 1 and removed 1 labels Oct 11, 2021
@exalate-issue-sync exalate-issue-sync bot added impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort labels Oct 12, 2021
@tylersmalley
Copy link
Contributor

Is this still a priority or something teams need?

@flash1293
Copy link
Contributor

Not relevant anymore for VisEditors as actual rendering got moved to elastic-charts which is handling this outside of Kibana

@tylersmalley tylersmalley removed loe:small Small Level of Effort impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. EnableJiraSync labels Mar 16, 2022
@tylersmalley
Copy link
Contributor

This isn't being requested anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Unit Testing Team:Operations Team label for Operations Team
Projects
None yet
Development

No branches or pull requests

5 participants