-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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
[@testing-library/jest-dom] Allow all elements #49707
Conversation
@nickmccurdy Thank you for submitting this PR! This is a live comment which I will keep updated. 1 package in this PRCode ReviewsBecause this is a widely-used package, a DT maintainer will need to review it before it can be merged. Status
Once every item on this list is checked, I'll ask you for permission to merge and publish the changes. InactiveThis PR has been inactive for 23 days — it is considered nearly abandoned! Diagnostic Information: What the bot saw about this PR{
"type": "info",
"now": "-",
"pr_number": 49707,
"author": "nickmccurdy",
"headCommitOid": "abfb39f187b6cc60fa7f93f2fc7abeeea102a5ca",
"lastPushDate": "2020-11-20T21:11:16.000Z",
"lastActivityDate": "2020-12-24T02:14:15.000Z",
"maintainerBlessed": false,
"hasMergeConflict": false,
"isFirstContribution": false,
"popularityLevel": "Critical",
"pkgInfo": [
{
"name": "testing-library__jest-dom",
"kind": "edit",
"files": [
{
"path": "types/testing-library__jest-dom/index.d.ts",
"kind": "definition"
}
],
"owners": [
"gnapse",
"jgoz",
"smacpherson64"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Critical"
}
],
"reviews": [
{
"type": "changereq",
"reviewer": "jgoz",
"date": "2020-11-20T21:31:10.000Z"
}
],
"ciResult": "pass"
} |
🔔 @gnapse @jgoz @smacpherson64 — please review this PR in the next few days. Be sure to explicitly select |
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.
Hmm, I don't believe this change reflects the actual runtime behavior in jest-dom. Both of these methods use checkHtmlElement
which explicitly verifies that they are instances of either HTMLElement
or SVGElement
.
The linked issue in react-testing-library discussed allowing elements such as <circle>
to be used directly, which are not instances of either of these two prototypes.
Therefore, I think the correct order of operations would be to first open a PR in jest-dom
to make these assertions compatible with the non-root SVG elements, and then reflect that in the typings.
@nickmccurdy One or more reviewers has requested changes. Please address their comments. I'll be back once they sign off or you've pushed new commits. Thank you! |
👋 Hi there! I’ve run some quick measurements against master and your PR. These metrics should help the humans reviewing this PR gauge whether it might negatively affect compile times or editor responsiveness for users who install these typings. Let’s review the numbers, shall we? Comparison details 📊
It looks like nothing changed too much. I won’t post performance data again unless it gets worse. |
I thought we could go without this, but it seems like Jest DOM's runtime type checking has gotten out of sync with other type updates we've made in the organization. To remedy this I've opened testing-library/jest-dom#313 upstream. Once that's fixed I may update this pull request. |
@nickmccurdy I haven't seen any activity on this PR in more than three weeks, and it still has problems that prevent it from being merged. The PR will be closed in a week if the issues aren't addressed. |
Intentionally keeping this open as it's blocked by testing-library/jest-dom#313 |
@nickmccurdy I haven't seen any activity on this PR in more than three weeks, and it still has problems that prevent it from being merged. The PR will be closed on Feb 15 (in a week) if the issues aren't addressed. |
This is still blocked but I'll close it temporarily to stop the bot from replying. |
npm test <package to test>
.If changing an existing definition:
tslint.json
containing{ "extends": "dtslint/dt.json" }
. If for reason the any rule need to be disabled, disable it for that line using// tslint:disable-next-line [ruleName]
and not for whole package so that the need for disabling can be reviewed.