React Testing Library · Method
userEvent.upload
userEvent.upload simulates selecting one or more files in a file input. Await it, then inspect the input's files collection.
Last updated
Syntax
upload(element: HTMLElement, fileOrFiles: File | File[]): Promise<void>In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
@testing-library/user-eventuserEvent.setup()Fileinput.filesapplyAcceptacceptmultiple