Create a sample unit test for FilterButton.
The general idea is that you load a component with some params, you render it in a virtual screen and then you check the values of its attributes and/or the presence of specific text.
Add jsdom dependency.
Move dev dependencies to devDependencies in package.json.
I haven't used @testing-library/react before. We used enzyme but it is deprecated in React 18 so I couldn't use it.
This setup may not be optimal but it works.
Create a sample unit test for
FilterButton
. The general idea is that you load a component with some params, you render it in a virtual screen and then you check the values of its attributes and/or the presence of specific text.Add
jsdom
dependency.Move dev dependencies to
devDependencies
inpackage.json
.Modify
npm run test
script to run the tests.