Ask your Question
I have a component which renders null if some data validation check do not pass.
I'd like to test this behavior using RNTL. Question: how do I do this?
For the record, we are using a custom renderWithProviders function, as suggested in Redux docs
I thought about wrapping the element I'm testing in a <View testId="artificial_root_view"> and then somehow verifying that this view has no children. But when I tried to do the following 👇🏻
expect(screen.getByTestId("artificial_root_view").children).toBeNull();
I got the following error:
expect(received).toBeNull()
Received: [{"_fiber": [FiberNode]}]