user-event icon indicating copy to clipboard operation
user-event copied to clipboard

Error: Diplayed value in UI can be `null`

Open hinogi opened this issue 6 months ago • 0 comments

Reproduction example

null

Prerequisites

Setting a value to null programmatically.

https://github.com/testing-library/user-event/blob/63ac399e06bd8f2397a6c581915acd29235f2d38/src/document/UI.ts#L24

Expected behavior

Nothing happens

Actual behavior

TypeError: right hand side of 'in' should be an object, got null Since EcmaScript returns object on typeof null this function is not safe

https://github.com/testing-library/user-event/blob/63ac399e06bd8f2397a6c581915acd29235f2d38/src/document/UI.ts#L24

User-event version

14.6.1

Environment

No response

Additional context

No response

hinogi avatar Jun 12 '25 11:06 hinogi