profiler
profiler copied to clipboard
Consider that we stop using `container` in favor of `document.body` in tests
In #3305 I disabled the new eslint test that checks when we use container. We do use container in tests for these cases:
- snapshot tests
- use of
querySelectorand friends
Advantages of using document.body:
- this is standard DOM
- we don't need to forward
containerfrom therenderresult to the test code - there's no difference with fragments or portals when doing queries
- the queries
getByTextand friends are usingdocument.bodyalready.
Drawbacks of using document.body:
- for Flow
document.bodycan benull, so this can be painful to useensureExistsor$FlowExpectErroreveywhere. - more nested output in snapshots
┆Issue is synchronized with this Jira Task