Search - update tests π¬
Overview
Our app is working, there are no errors in the browser console, but we need to check and update tests:
- The test suite for
<App />
should fail, specifically the snapshot test ("renders correctly"). Look for red text:β App βΊ renders correctly
. - Our new component
<SearchForm />
has no tests. What tests would you write here?
1. Fix existing tests
This one is easy, you've done it a couple of times already. π
2. Write new tests for <SearchForm />
As with any testing, let's first think of what we can test, remembering some techniques/type of tests available in RTL:
- we can do snapshot testing again,
- we can check if
<button>
displays the correct text.
Can you write these tests yourself without a walkthrough?