Testing Library vs e2e
Where do people draw the line between testing library and e2e testing? In react native, e2e takes forever, can be flaky, and is yet another framework to learn/setup/deploy. I've resorted to using testing library as my e2e, and then manually do spot inspections. Seems to work…
How do I let RTL change component state on triggering onChange?
I'm using fireEvent.change(getByTestId('some-id')), and after that, I'm triggering a button's click using fireEvent and it runs a method that does an async operation and after getting a response from server it updates the state of the component. I'm confused when RTL fireEvent…
How are you testing panding states of your application?
I want to make sure that the users gets feedback if something is loading after an action got triggered. For example a loading spinner is displayed after a form is submitted. Therefore I need to assert just before the request gets resolved. How are you testing this? My current…
Test that something is not on the page
I have a test similar to this one This works fine. I would like to do the opposite. I want to test non-admin can not open the modal. In this scenario the button is still on the page, it just doesn't open the modal on click. I'm aware I can do expect(queryByText('The modal…
create-react-app --typescript and VSCode
I created a new app using create-react-app with the --typescript flag. This generates the file src/App.tsx. When I open this file in VS Code I get lots of "problems" identified before I even change any of the generated code. The first error is on the "div" tag returned by the…