From 82521a56446aefcf3f973480a2333755c0aed662 Mon Sep 17 00:00:00 2001 From: Jordan Edmunds Date: Wed, 5 Oct 2022 17:25:37 -0400 Subject: [PATCH] Update setup to include import statement I spent an hour trying to figure out what was wrong with my code, not realizing that user-events was an unnamed export. Please put an import statement somewhere in the docs, if not here, to save poor idiots like myself. --- docs/user-event/setup.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/user-event/setup.mdx b/docs/user-event/setup.mdx index 22279def5..77546ab4d 100644 --- a/docs/user-event/setup.mdx +++ b/docs/user-event/setup.mdx @@ -27,6 +27,8 @@ This allows to write multiple consecutive interactions that behave just like the described interactions by a real user. ```js +import userEvent from "@testing-library/user-event"; + const user = userEvent.setup() await user.keyboard('[ShiftLeft>]') // Press Shift (without releasing it)