diff --git a/packages/mui-material/src/Grid2/Grid2.test.js b/packages/mui-material/src/Grid2/Grid2.test.js index 43f78bb96616c1..533a3f0502d9e4 100644 --- a/packages/mui-material/src/Grid2/Grid2.test.js +++ b/packages/mui-material/src/Grid2/Grid2.test.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import { createRenderer } from '@mui/internal-test-utils'; +import { createRenderer, screen } from '@mui/internal-test-utils'; import Grid2, { grid2Classes as classes } from '@mui/material/Grid2'; import { createTheme, ThemeProvider } from '@mui/material/styles'; import { expect } from 'chai'; @@ -24,8 +24,8 @@ describe('', () => { })); it('should render with the container class', () => { - const { getByTestId } = render(); - expect(getByTestId('grid')).to.have.class(classes.container); + render(); + expect(screen.getByTestId('grid')).to.have.class(classes.container); }); it('should have container styles passed from theme', () => { @@ -40,13 +40,13 @@ describe('', () => { }, }, }); - const { getByTestId } = render( + render( hello , ); - expect(getByTestId('grid')).to.have.style('padding', '11px'); + expect(screen.getByTestId('grid')).to.have.style('padding', '11px'); }); });