const { getByTestId } = testingHelpers.renderWithProviders(
<ProductDetailScreen {...testProps} />,
{
preloadedState: preloadedState,
}
);
const productSpecificationsTitleView = getByTestId(
TestIds.PRODUCT_DETAIL.PRODUCT_SPECIFICATION_TITLE
);
expect(productSpecificationsTitleView).toBeDefined();
await act(async () => {
await fireEvent.press(productSpecificationsTitleView);
});
const productSpecificationsContentView = getByTestId(
TestIds.PRODUCT_DETAIL.PRODUCT_SPECIFICATION_CONTENT
);
expect(productSpecificationsContentView).toBeDefined();
});
Whether or not i press the title the content is still present in the dom
Used & tested:
toBeDefined
toBeOnScreen
toBeNull
toBeVisible
but above all fails
i used queryByTestId, getByTestId, queryByText
Whether or not i press the title the content is still present in the dom
Used & tested:
toBeDefined
toBeOnScreen
toBeNull
toBeVisible
but above all fails
i used queryByTestId, getByTestId, queryByText