[test] apiRef.current.rootElementRef.current
is null when running test without Strict Mode
#8785
Open
2 tasks done
Labels
component: data grid
This is the name of the generic UI component, not the React module!
plan: Pro
Impact at least one Pro user
test
Duplicates
Latest version
Steps to reproduce 🕹
Link to live example:
Steps:
yarn jest
Current behavior 😯
column headers are not rendered in jest dom
Expected behavior 🤔
column headers should render
Context 🔦
This is happening because the renderContext in
useGridColumnHeaders
is set to null.You can see here I'm logging out the params for the
getColumnsToRender
function in the hook.You can also see that the result is that no element with a role of 'columnheader' is rendered
This statement in
getColumnsToRender
returns null which causesgetColumnHeaders
to also return nullThis is no bueno because the
GridColumnHeaders
component uses these functions to render thecolumnheader
elements.This is all happening because the
handleScroll
function is never called which seems to be the only function that actuall callssetRenderContext
And that happens because the dependency array for
updateInnerPosition
never triggers the callback.As you can see this happens even with the most basic of
DataGrid
tests.Your environment 🌎
npx @mui/envinfo
Order ID or Support key 💳 (optional)
37b83db94a4536050ab7b3cc2e79a6a5Tz01NjU3NixFPTE3MDMzNDc4NzI4MjAsUz1wcm8sTE09cGVycGV0dWFsLEtWPTI=
The text was updated successfully, but these errors were encountered: