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

Shallow snapshot tests of connected components are not useful #1044

Open
mturley opened this issue Oct 4, 2019 · 0 comments

Comments

@mturley
Copy link
Contributor

commented Oct 4, 2019

A lot of the unit tests in this repo rely on shallow-rendered snapshot tests to assert the rendered tree that results from certain props/state of a component. The utility of these tests is already debatable when they actually snapshot the rendered tree, but as part of #1030, some of those tests are now snapshotting one level up, where they only capture the props of a connected component, making them fairly meaningless.

When time allows, we should look at these way-too-shallow unit tests (most of their snapshots start with <Connect(Form(..., an example: https://github.com/ManageIQ/manageiq-v2v/pull/1030/files#diff-a11b70c072473da9e6352773498d1e2cR4) and do one of 3 things with each:

  1. Replace the snapshot with imperative tests that check the actual parts of the tree we're looking for
  2. Refactor the component so that the inner un-connected component is exported (no more export reduxForm(...), do that in the index.js file), so that the snapshot goes back to how it was
  3. If the test isn't useful anyway, remove it to make our test coverage more accurate
@mturley mturley added this to Backlog in v2v UI via automation Oct 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
v2v UI
  
Backlog
1 participant
You can’t perform that action at this time.