[Grid2] Container prop and custom theme fails tests due to missing theme.breakpoints #44539
Labels
bug 🐛
Something doesn't work
component: Grid
The React component.
customization: theme
Centered around the theming features
Steps to reproduce
Steps:
npm test
)container
prop from<Grid2 />
inComponent.jsx
Current behavior
The test fails with the following output:
Expected behavior
The test should be successful.
Context
We want to define custom colors in addition to the default Material UI theme. Doing so and then importing the theme with
useTheme()
crashes all our component tests, that use aGrid2
.I assume that
Grid2
incontainer
mode is not usingtheme.breakpoints
correctly. It is returned fromuseTheme()
, as you can see in the in the test output (console.log()
inComponent.test.jsx
).Your environment
npx @mui/envinfo
Search keywords: Grid2 container breakpoints theme custom-theme
The text was updated successfully, but these errors were encountered: