Skip to content

Commit

Permalink
Use stable class name
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasTy committed May 22, 2024
1 parent 88a42a2 commit 0653ee4
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions test/utils/pickers/describePicker/describePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,23 @@ function innerDescribePicker(ElementToTest: React.ElementType, options: Describe
this.skip();
}

render(<ElementToTest disableOpenPicker {...propsToOpen} />);
render(
<ElementToTest
disableOpenPicker
{...propsToOpen}
slotProps={{
layout: {
classes: {
contentWrapper: 'test-pickers-content-wrapper',
},
},
}}
/>,
);

expect(screen.queryByRole('button', { name: /Choose/ })).to.equal(null);
// check if anything has been rendered inside the layout content wrapper
expect(document.querySelector('.MuiPickersLayout-contentWrapper')?.hasChildNodes()).to.equal(
expect(document.querySelector('.test-pickers-content-wrapper')?.hasChildNodes()).to.equal(
true,
);
});
Expand Down

0 comments on commit 0653ee4

Please sign in to comment.