Skip to content

Commit

Permalink
remove deprecated props from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sai6855 committed Jul 18, 2023
1 parent 1e92db4 commit 3282d17
Showing 1 changed file with 37 additions and 5 deletions.
42 changes: 37 additions & 5 deletions packages/mui-material/src/Modal/Modal.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ describe('<Modal />', () => {
}

render(
<Modal open BackdropComponent={TestBackdrop}>
<Modal open slots={{ backdrop: TestBackdrop }}>
<div />
</Modal>,
);
Expand Down Expand Up @@ -165,7 +165,15 @@ describe('<Modal />', () => {
return <div data-testid="backdrop" data-timeout={transitionDuration} />;
}
render(
<Modal open BackdropComponent={TestBackdrop} BackdropProps={{ transitionDuration: 200 }}>
<Modal
open
slots={{ backdrop: TestBackdrop }}
slotProps={{
backdrop: {
transitionDuration: 200,
},
}}
>
<div />
</Modal>,
);
Expand All @@ -176,7 +184,15 @@ describe('<Modal />', () => {
it('should attach a handler to the backdrop that fires onClose', () => {
const onClose = spy();
const { getByTestId } = render(
<Modal onClose={onClose} open BackdropProps={{ 'data-testid': 'backdrop' }}>
<Modal
onClose={onClose}
open
slotProps={{
backdrop: {
'data-testid': 'backdrop',
},
}}
>
<div />
</Modal>,
);
Expand Down Expand Up @@ -220,7 +236,15 @@ describe('<Modal />', () => {
it('should call through to the user specified onBackdropClick callback', () => {
const onBackdropClick = spy();
const { getByTestId } = render(
<Modal onBackdropClick={onBackdropClick} open BackdropProps={{ 'data-testid': 'backdrop' }}>
<Modal
onClose={(event, reason) => {
if (reason === 'backdropClick') {
onBackdropClick();
}
}}
open
slotProps={{ backdrop: { 'data-testid': 'backdrop' } }}
>
<div />
</Modal>,
);
Expand All @@ -241,7 +265,15 @@ describe('<Modal />', () => {
}
const onBackdropClick = spy();
const { getByTestId } = render(
<Modal onBackdropClick={onBackdropClick} open BackdropComponent={CustomBackdrop}>
<Modal
onClose={(event, reason) => {
if (reason === 'backdropClick') {
onBackdropClick();
}
}}
open
slots={{ backdrop: CustomBackdrop }}
>
<div />
</Modal>,
);
Expand Down

0 comments on commit 3282d17

Please sign in to comment.