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

Rewrite JS tests that rely on specific implementation details #837

Open
gsidebo opened this issue Mar 20, 2020 · 0 comments
Open

Rewrite JS tests that rely on specific implementation details #837

gsidebo opened this issue Mar 20, 2020 · 0 comments

Comments

@gsidebo
Copy link
Contributor

gsidebo commented Mar 20, 2020

We have some React component tests that make assertions about what internal convenience methods exist in component classes, when they are called, and what arguments they are given. There are also elaborate patches set up to stub out some of those convenience methods. The net result of this:

  1. The test files are unnecessary large and difficult to read
  2. Making simple implementation changes that cause no functional change, or simple changes to the component rendering output, can cause many tests to fail, and getting them working again is often difficult.

The biggest area of concern is static/js/containers/CollectionDetailPage_test.js, but static/js/containers/VideoDetailPage_test.js also needs work and possibly a few others. In general, these tests should not patch internal convenience methods, the nesting of describe/it blocks and creation of custom helper methods in the tests should be kept to a minimum, and the testing of rendering output should be done by just rendering the entire component.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant