Skip to content
Discussion options

You must be logged in to vote

We recommend invoking userEvent.setup() before the component is rendered.

You could add user on a different function. E.g. in our own tests we have a render function without user and a setup function that adds user.

But if it's for avoiding an unnecessary invocation, it's probably not worth the extra choice for the test author.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@bpinto
Comment options

@ph-fritsche
Comment options

Answer selected by bpinto
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