How do I test my custom dropdown component with react-testing library…
I am using a third party component called react-dropdown (https://github.com/fraserxu/react-dropdown) I want to test in my application that it renders seven values. Which it does as shown in this demo: https://codesandbox.io/s/pj938w2640 …
Testing functional component methods + typescript
Quite new to writing tests, and have to also jump in the deep end with doing it in Typescript on a project I have some functional component methods placed inside the function that I want to spy on to check if they are called with correct props after a user has performed an…
findAllByTestId that starts with common prefix
I have a list of items, which I loop over. Each item has a wrapper then the content: In my test, I am verifying the content of the companyName-* items. So I would like to use the findAllByTestId, then loop through those and verify the inner text is the company.name value. …
Testing different timezone behaviours?
Does anyone have any ideas on how to go about testing for different timezones? My UI changes for different timezones and it would be great to be able to test. I've tried some mocking libraries (e.g. MockDate, timezone-mock) but they break in different ways.
Configure storyshots of Storybook with react-testing-library
I'm trying to add snapshots using storybook v5.0.5 and react-testing-library v6.0.3 to do structural testing of all my stories. I'm trying to follow the docs: https://github.com/infinitered/addon-storyshots/blob/master/README.md#serializer …