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

Typings for event functions requires HTMLElement, but querySelector (et. al) returns Element #149

Closed
Alxandr opened this issue Nov 7, 2018 · 1 comment · Fixed by #150
Labels

Comments

@Alxandr
Copy link
Contributor

Alxandr commented Nov 7, 2018

  • dom-testing-library version: 3.12.0
  • react version: 16.7.0-alpha.0
  • node version: 0.13.0
  • npm (or yarn) version: 1.12.1

Relevant code or config:

fireEvent.click(container.querySelector('.backButton')!);

What you did:

Tried to trigger a click on a result of querySelector.

What happened:

Typescript complained (did not build).

Reproduction:

Any typescript project with the line above should produce the issue.

Problem description:

It disallows code that is perfectly valid.

Suggested solution:

Allow events to accept Element.

Alxandr added a commit to Alxandr/dom-testing-library that referenced this issue Nov 7, 2018
@kentcdodds
Copy link
Member

🎉 This issue has been resolved in version 3.12.2 🎉

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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants