Skip to content

Can the Fragment tag be enabled to support data-testid ? #569

Closed Answered by gnapse
wangcongyi asked this question in Q&A
Discussion options

You must be logged in to vote

The Fragment React element does not render anything to the DOM (not even an empty tag, whatever that means).

jest-dom is not React-specific. It is not even React-aware. It is only DOM-aware. If something in React does not add anything to the DOM, it cannot have data- attributes.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by gnapse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants