Skip to content

Commit

Permalink
use screen
Browse files Browse the repository at this point in the history
  • Loading branch information
sai6855 committed Nov 30, 2024
1 parent 90deddc commit 4a21e8b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/mui-material/src/Grid2/Grid2.test.js
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -24,8 +24,8 @@ describe('<Grid2 />', () => {
}));

it('should render with the container class', () => {
const { getByTestId } = render(<Grid2 data-testid="grid" container />);
expect(getByTestId('grid')).to.have.class(classes.container);
render(<Grid2 data-testid="grid" container />);
expect(screen.getByTestId('grid')).to.have.class(classes.container);
});

it('should have container styles passed from theme', () => {
Expand All @@ -40,13 +40,13 @@ describe('<Grid2 />', () => {
},
},
});
const { getByTestId } = render(
render(
<ThemeProvider theme={theme}>
<Grid2 data-testid="grid" container>
hello
</Grid2>
</ThemeProvider>,
);
expect(getByTestId('grid')).to.have.style('padding', '11px');
expect(screen.getByTestId('grid')).to.have.style('padding', '11px');
});
});

0 comments on commit 4a21e8b

Please sign in to comment.