Geo Replicables - Unit Test Cleanup
What / Why
Originally called out by @slashmanov via code review: !122126 (comment 1415600546)
Similar to Geo Sites - Unit Test Cleanup: #329569 (closed)
The patterns used in the ee/spec/geo_replicable were written a few years ago and aren't up to our latest frontend testing best practices.
Some things that should be addressed
- We shouldn't be "re-implementing" the Vuex store in the spec
- Rather we should use the original store and stand it up with mutations, then mock the actual effects of the actions in the component specs.
- We should utilize better finders like
findByTestId
andfindByText
- Better organize the
actions_spec.js
to reduce the line count from 721 and properly mock/test the Geo GraphQL client. - Reduce layered complexity in the
mock_data.js
Thought
It may be worth waiting for #219417 (closed) to be closed as it will allow us to reduce the complexity of this component set by quite a bit.
Proposal
- Bring ee/spec/geo_replicable up to our frontend testing best practices based on the suggested/thoughts above.
Edited by Zack Cuddy