Skip to content

Is there a reason why the return type of render is not HTMLElement? #274

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

Closed
sunecosuri opened this issue Jul 6, 2022 · 2 comments
Closed

Comments

@sunecosuri
Copy link

The following lines.
https://github.com/testing-library/vue-testing-library/blob/main/types/index.d.ts#L21-L22

I thought it would be more convenient to same as arguments like findBy~~~ in query the HTMLElement type.
https://github.com/testing-library/dom-testing-library/blob/main/types/queries.d.ts#L63

Is there any reason?

@afontcu
Copy link
Member

afontcu commented Jul 6, 2022

Hi! The main reason is that HTMLElement does not include SVG elements: testing-library/react-testing-library#833

thank you for the question!

@afontcu afontcu closed this as completed Jul 6, 2022
@SCasarotto
Copy link

I went looking for this exact same thing. I noticed in the react-testing-library there was some sort of solution to this. testing-library/react-testing-library#868 Is there a reason not to follow suite here in vue-testing-library?

The other reason I feel this is reasonable is that all the query functions returned from render assume they received an HTMLElement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants