Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Click on a checkbox generate a Maximum call stack size exceeded error #848

Closed
GabrielBarcelos1 opened this issue Feb 8, 2022 · 3 comments · Fixed by #850
Closed

Click on a checkbox generate a Maximum call stack size exceeded error #848

GabrielBarcelos1 opened this issue Feb 8, 2022 · 3 comments · Fixed by #850
Labels
bug Something isn't working released on @beta
Milestone

Comments

@GabrielBarcelos1
Copy link

GabrielBarcelos1 commented Feb 8, 2022

  • @testing-library/user-event version: 14.0.0-beta.9
  • Testing Framework and version: @testing-library / 13.0.0-alpha.5
  • DOM Environment: 27.5.0

What you did: I just need to click on a checkBox

What happened: When I click on checkBox my test stops and returns:

    RangeError: Maximum call stack size exceeded

      at innerInvokeEventListeners (node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:341:9)
      at invokeEventListeners (node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:274:3)
      at HTMLInputElementImpl._dispatch (node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:205:9)
      at HTMLInputElementImpl.dispatchEvent (node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:94:17)
      at HTMLInputElement.dispatchEvent (node_modules/jsdom/lib/jsdom/living/generated/EventTarget.js:231:34)
      at dispatchEvent (node_modules/@testing-library/user-event/dist/index.cjs:1420:12)
      at isElementType.type (node_modules/@testing-library/user-event/dist/index.cjs:1393:7)
      at dispatchEvent (node_modules/@testing-library/user-event/dist/index.cjs:1422:7)
      at isElementType.type (node_modules/@testing-library/user-event/dist/index.cjs:1393:7)
      at dispatchEvent (node_modules/@testing-library/user-event/dist/index.cjs:1422:7)

Problem description: after this PR #847, click on a checkbox generate a Maximum call stack size exceeded error

@ph-fritsche
Copy link
Member

ph-fritsche commented Feb 8, 2022

Works as expected in codesandbox:
https://codesandbox.io/s/userevent-pr-template-forked-k8sl1?file=/src/App.test.js

Could you please provide more information about the test and the component under test?

I guess this means @testing-library/react@13.0.0-alpha.5

  • DOM Environment: 27.5.0

Is this jest+jsdom?

@ph-fritsche
Copy link
Member

The loop is a result of the control being nested inside <label>. PR with a fix coming soon.

@ph-fritsche ph-fritsche added bug Something isn't working and removed bug Something isn't working labels Feb 8, 2022
@ph-fritsche ph-fritsche added this to the userEvent v14 milestone Feb 8, 2022
@github-actions
Copy link

github-actions bot commented Feb 8, 2022

🎉 This issue has been resolved in version 14.0.0-beta.10 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released on @beta
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants