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

fix: error trying to do in on a null value in is ui function call

Open kalvenschraut opened this issue 2 years ago • 1 comments

I am having a hard time narrowing down exactly when this is occurring, but overall the error is easy to address so haven't come up with exact reproduction. If required I can spend more time doing so.

Overall issue seems to be that sometimes the value of an input is set to null which is causing the isUIValue check to be called from the interceptorImpl function. With null being passed in an error is thrown which causes vitest to exit non zero.

My stack is vitest/quasar/happy-dom so maybe an issue somewhere else if it is felt that this function should not take in null as a type.

kalvenschraut avatar May 13 '23 05:05 kalvenschraut

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit e2b1d6430c6aa320a72e73823b5fe82604cb6d99:

Sandbox Source
userEvent-dom Configuration
userEvent-react Configuration

codesandbox-ci[bot] avatar May 13 '23 05:05 codesandbox-ci[bot]

Thanks for contributing to this library.

HTMLInputElement.value and HTMLTextAreaElement.value are always string in browsers. If happy-dom returns null, I'd consider this a bug in their DOM implementation. Is this still an issue?

ph-fritsche avatar Jan 30 '25 11:01 ph-fritsche

I was maintaining a patch with this PR in it but updating and not replying the patch and there is no longer an issue occurring for me. Possible happy dom fixed this issue, if it pops up again I will open an issue over there.

thanks

kalvenschraut avatar Jan 30 '25 17:01 kalvenschraut