-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(types): Allow all HTML and SVG elements in render. (#833)
Co-authored-by: Sebastian Silbermann <silbermann.sebastian@gmail.com>
- Loading branch information
1 parent
456424f
commit 1dc33b2
Showing
1 changed file
with
6 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1dc33b2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joebobmiles @eps1lon
Dear All,
I'm afraid this commit introduces unnecessary compilation errors in TS:
render
function returns an object withcontainer: Element
, as shown abovegetByTestId
et all, requirecontainer
to beHTMLElement
. Yes, you can have a boundgetByTestId
when you extract it fromrender
's result, but you can also import it directly from RTL and use it in an unbound fashion. Sometimes you have to do that!HTMLElement
beingElement
, butElement
not necessarily beingHTMLElement
(subtype, covariance)As a consequence, I can't pass the
container
from render intogetByTestId
. And I think I should be able to (no compiler errors should arise).1dc33b2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ducin Sorry to hear you're having trouble. Would you be so kind and open an issue that follows the template? This helps us triage and track the issue.
1dc33b2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @ducin thanks for sharing this.
We already have a PR going to fix that and these two issues relate to it: #841, testing-library/dom-testing-library#838. You can follow our progress here: testing-library/dom-testing-library#834