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

Refactor vislib tests into integration tests #67762

Closed
flash1293 opened this issue May 29, 2020 · 3 comments
Closed

Refactor vislib tests into integration tests #67762

flash1293 opened this issue May 29, 2020 · 3 comments
Labels
Feature:NP Migration Feature:Vislib Vislib chart implementation Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@flash1293
Copy link
Contributor

In https://github.com/flash1293/kibana/tree/bf04235dae35452061cc7ea3d86d96c19a58206c/src/legacy/core_plugins/kibana/public/__tests__/vis_type_vislib there are a bunch of legacy tests which can't be migrated to jest because they rely on a real browser running.

These should be converted to integration tests similar to the licensing tests in https://github.com/flash1293/kibana/tree/bf04235dae35452061cc7ea3d86d96c19a58206c/x-pack/test/licensing_plugin

These work by using the functional test runner to actually start Kibana in a browser. To be able to call functions in this context, a test plugin is necessary which exposes its functions via the window object (handled in https://github.com/flash1293/kibana/blob/bf04235dae35452061cc7ea3d86d96c19a58206c/test/plugin_functional/plugins/core_provider_plugin/public/index.ts for the licensing tests).

To start the functional test server with the test plugin loaded, a custom config file is necessary (like here: https://github.com/flash1293/kibana/blob/bf04235dae35452061cc7ea3d86d96c19a58206c/x-pack/test/licensing_plugin/config.public.ts#L24 )

In case of the vislib tests, the test plugin should contain the getVis function setting up the dom and everything around it: https://github.com/flash1293/kibana/blob/bf04235dae35452061cc7ea3d86d96c19a58206c/src/legacy/core_plugins/kibana/public/__tests__/vis_type_vislib/_vis_fixture.js

The functional test cases can mostly contain the current tests wrapped in browser.executeAsync (like here in the licensing tests: https://github.com/flash1293/kibana/blob/bf04235dae35452061cc7ea3d86d96c19a58206c/x-pack/test/licensing_plugin/public/updates.ts#L46-L47 )

@flash1293 flash1293 added Feature:Vislib Vislib chart implementation Team:Visualizations Visualization editors, elastic-charts and infrastructure Feature:NP Migration labels May 29, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@flash1293
Copy link
Contributor Author

cc @dziyanadzeraviankina

@flash1293
Copy link
Contributor Author

Tests are converted to jest unit tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:NP Migration Feature:Vislib Vislib chart implementation Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

No branches or pull requests

2 participants