Refactor vislib tests into integration tests #67762
Labels
Feature:NP Migration
Feature:Vislib
Vislib chart implementation
Team:Visualizations
Visualization editors, elastic-charts and infrastructure
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.jsThe 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 )The text was updated successfully, but these errors were encountered: