OpenSearch-Dashboards
OpenSearch-Dashboards copied to clipboard
[VizBuilder] Increase test coverage
trafficstars
Parent task to fill in the gaps from the low initial coverage that the VisBuilder has.
Sub tasks:
- [ ] Add unit tests to functional code where it makes sense
- [ ] Investigate and document functional testing flow to see if they can be made easier to write and debug
- [ ] Add missing functional test workflows
Missing unit tests
- [ ]
src/plugins/wizard/public/application/utils/get_top_nav_config.tsx - [ ]
src/plugins/wizard/public/application/utils/validate_schema_state.ts - [ ]
src/plugins/wizard/public/application/utils/usefiles - [ ]
src/plugins/wizard/public/application/components/data_tab/utils/get_available_fields.ts
Missing functional tests
- [ ] Save workflow
- [ ] View on dashboards
- [ ] Edit from dashboards
- [ ] Create from dashboards: https://github.com/opensearch-project/OpenSearch-Dashboards/issues/2458 https://github.com/opensearch-project/OpenSearch-Dashboards/issues/2460
- [ ] Edit from Visualization listing
- [ ] Metric tests
- [ ] Bar chart tests
- [ ] Line chart tests
- [ ] Area Chart tests
- [ ] Drag and Drop test
- [ ] Change datasource
[Follow-up]: Negative code coverage? Maybe we should have a rule if negative code coverage point to new functional tests.
[Follow-up 2]: Is there another way to calculate coverage accurately from a functional tests view point.
See also:
- https://github.com/opensearch-project/OpenSearch-Dashboards/issues/1884
- https://github.com/opensearch-project/OpenSearch-Dashboards/issues/1885
Save workflow is blocked by https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2627#issuecomment-1292841626. Will track adding a test workflow as a part of that separately. Closing this issue in the meantime.