May 2019
Intermediate to advanced
496 pages
10h 38m
English
If you run your tests now, they should be green. However, any time you refactor tests in this way, you should verify that you're still testing the right thing by unwinding the production code and watching the test fail. It's all too easy to build tests that produce false positives, which are tests that pass when they shouldn't.
To check that our tests still work, locate this line in src/CustomerForm.js:
<form id="customer" onSubmit={() => onSubmit(customer)}>
Remove the onSubmit prop entirely:
<form id="customer">
If you run tests now, you'll get multiple test failures from various different tests. However, we're only interested in this one test generator, so update its declaration to it.only rather than it:
it.only('saves ...Read now
Unlock full access