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

Convert vega tests to jest #71073

Merged
merged 14 commits into from
Jul 14, 2020

Conversation

DianaDerevyankina
Copy link
Contributor

Part of #57813

Summary

Converted vega tests to jest and removed old ones from legacy.

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@DianaDerevyankina DianaDerevyankina added Feature:Visualizations Generic visualization features (in case no more specific feature label is available) v8.0.0 release_note:skip Skip the PR/issue when compiling release notes Feature:NP Migration v7.9.0 labels Jul 8, 2020
@DianaDerevyankina DianaDerevyankina self-assigned this Jul 8, 2020
@DianaDerevyankina
Copy link
Contributor Author

@elasticmachine merge upstream

@elasticmachine
Copy link
Contributor

user doesn't have permission to update head repository

@alexwizp
Copy link
Contributor

alexwizp commented Jul 9, 2020

@elasticmachine merge upstream

@elasticmachine
Copy link
Contributor

user doesn't have permission to update head repository

@DianaDerevyankina DianaDerevyankina added the Team:Visualizations Visualization editors, elastic-charts and infrastructure label Jul 9, 2020
@alexwizp
Copy link
Contributor

@elasticmachine merge upstream

@elasticmachine
Copy link
Contributor

user doesn't have permission to update head repository

@alexwizp
Copy link
Contributor

@elasticmachine merge upstream

@elasticmachine
Copy link
Contributor

user doesn't have permission to update head repository

@alexwizp alexwizp marked this pull request as ready for review July 13, 2020 14:00
@alexwizp alexwizp requested a review from a team July 13, 2020 14:00
@elasticmachine
Copy link
Contributor

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

@timroes timroes mentioned this pull request Jul 14, 2020
20 tasks
Copy link
Contributor

@VladLasitsa VladLasitsa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Contributor

@sulemanof sulemanof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't use the __test__ folder name for jest test utils, as this is reserved folder name for karma/mocha env. You could use test or test_utils instead

Comment on lines 90 to 103
vegaVisualizationDependencies = {
core: {
uiSettings: coreStart.uiSettings,
},
plugins: {
data: {
query: {
timefilter: {
timefilter: {},
},
},
},
},
};
Copy link
Contributor

@sulemanof sulemanof Jul 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to TS VegaVisualizationDependencies seems that right implementation of this mock is:

Suggested change
vegaVisualizationDependencies = {
core: {
uiSettings: coreStart.uiSettings,
},
plugins: {
data: {
query: {
timefilter: {
timefilter: {},
},
},
},
},
};
vegaVisualizationDependencies = {
core: coreMock.createSetup(),
plugins: {
data: dataPluginMock.createSetupContract()
},
};

This will help to avoid TS errors when moving to typescript (if it will)

@sulemanof
Copy link
Contributor

I noticed there is the src/plugins/vis_type_vega/public/__mocks__ folder, which seems doesn't have any links on it in the existing kibana codebase. I bet these are mocks for legacy implementation and it has been just left during the migration.
Could you please check it and remove if unnecessary?

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Contributor

@sulemanof sulemanof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@stratoula stratoula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🍰

@DianaDerevyankina DianaDerevyankina merged commit 7d57be6 into elastic:master Jul 14, 2020
DianaDerevyankina added a commit to DianaDerevyankina/kibana that referenced this pull request 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 pull request 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]>
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) release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.9.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants