-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Convert tag cloud, vega and table tests to jest #57813
Labels
Feature:NP Migration
Feature:Visualizations
Generic visualization features (in case no more specific feature label is available)
Team:Visualizations
Visualization editors, elastic-charts and infrastructure
Comments
flash1293
added
Feature:Visualizations
Generic visualization features (in case no more specific feature label is available)
Team:Visualizations
Visualization editors, elastic-charts and infrastructure
Feature:NP Migration
labels
Feb 17, 2020
Pinging @elastic/kibana-app (Team:KibanaApp) |
flash1293
changed the title
Convert tag cloud and vega tests to jest
Convert tag cloud, vega and table tests to jest
May 29, 2020
5 tasks
DianaDerevyankina
added a commit
to DianaDerevyankina/kibana
that referenced
this issue
Jul 8, 2020
7 tasks
DianaDerevyankina
added a commit
that referenced
this issue
Jul 14, 2020
* Convert vega tests to jest Part of #57813 * Remove unused config * Move assets to __test__ folder and remove unnecessary code * clenup * cleanup * Revert default.spec.hjson file and mock default_spec * Refactor some code Co-authored-by: Alexey Antonov <[email protected]>
DianaDerevyankina
added a commit
to DianaDerevyankina/kibana
that referenced
this issue
Jul 14, 2020
* Convert vega tests to jest Part of elastic#57813 * Remove unused config * Move assets to __test__ folder and remove unnecessary code * clenup * cleanup * Revert default.spec.hjson file and mock default_spec * Refactor some code Co-authored-by: Alexey Antonov <[email protected]>
DianaDerevyankina
added a commit
that referenced
this issue
Jul 14, 2020
* Convert vega tests to jest Part of #57813 * Remove unused config * Move assets to __test__ folder and remove unnecessary code * clenup * cleanup * Revert default.spec.hjson file and mock default_spec * Refactor some code Co-authored-by: Alexey Antonov <[email protected]> Co-authored-by: Alexey Antonov <[email protected]>
Closed by linked PRs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Feature:NP Migration
Feature:Visualizations
Generic visualization features (in case no more specific feature label is available)
Team:Visualizations
Visualization editors, elastic-charts and infrastructure
The tag cloud, vega and data table tests are currently using karma, angular mocking, visual diffs and require a real browser environment. To convert them to jest, multiple pieces have to be completed
Validate svg instead of rendered canvas
These tests have to be replaced by snapshot tests validating the svg tree instead of the rendered canvas. This has the additional benefit of being more stable than pixel comparisons (because of different fonts, ...)
For tag cloud, the following patching of jsdom apis tricks the rendering component into thinking there is enough space to layout the elements (the layouting itself happens within d3 and doesn't require a real dom):
For vega specs, adding
to the spec sets the size of the rendering area and makes sure an svg tree is created.
Get rid of ngMock and contracts of other plugins
Vis
object is needed to render successfully, the necessary parts can be simulated by an inline mockcreateBaseVisualization
of thevisualizations
plugin is setting up should be simulated by inline mocks if necessaryGet rid of hson files
Vega stores the test specs in
hson
files. In the new platform there is no raw loader - convert hson files to json, import json directly and pass it into the visualizations viaJSON.stringify
.Add smoke test with FTR and percy
To test the wider integration, add a functional test runner test for tag cloud and vega doing a simple visual regression test via percy.
The text was updated successfully, but these errors were encountered: