Open Shail-Patel-1 opened 1 year ago
I tested on this way
const firstItemCollapsable = screen.getByTestId(
`${LongformContentNavigationTestIDs.outlineListItemContainer}.${mockedRoutes[0].id}`,
).children[1];
/// is hidden
expect(firstItemCollapsable.instance.props.collapsed).toBe(true);
fireEvent.press(firstItemIcon);
/// is collapsed
expect(firstItemCollapsable.instance.props.collapsed).toBe(false);
fireEvent.press(firstItemIcon);
/// is hidden again
expect(firstItemCollapsable.instance.props.collapsed).toBe(true);
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