Skip to content

Commit

Permalink
Merge branch 'slider-custom-marks-nan' of https://github.com/joshkel/…
Browse files Browse the repository at this point in the history
…material-ui into slider-custom-marks-nan
  • Loading branch information
ZeeshanTamboli committed Jan 21, 2025
2 parents 4556e41 + d8f1689 commit ef2463f
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions packages/mui-material/src/Slider/Slider.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1196,18 +1196,18 @@ describe('<Slider />', () => {
});
});

it(`stops at the max value with custom marks`, () => {
const handleChange = stub().callsFake((_event, value) => value);
const { getByRole } = render(
it('stops at the max value with custom marks', () => {
const handleChange = stub();
render(
<Slider
marks={[10, 20, 30].map((value) => ({ value }))}
marks={[{ value: 10 }, { value: 20 }, { value: 30 }]}
step={null}
value={30}
onChange={handleChange}
/>,
);

const slider = getByRole('slider');
const slider = screen.getByRole('slider');
expect(slider).to.have.attribute('aria-valuenow', '30');

act(() => {
Expand All @@ -1220,18 +1220,18 @@ describe('<Slider />', () => {
expect(slider).to.have.attribute('aria-valuenow', '30');
});

it(`stops at the min value with custom marks`, () => {
const handleChange = stub().callsFake((_event, value) => value);
const { getByRole } = render(
it('stops at the min value with custom marks', () => {
const handleChange = stub();
render(
<Slider
marks={[10, 20, 30].map((value) => ({ value }))}
marks={[{ value: 10 }, { value: 20 }, { value: 30 }]}
step={null}
value={10}
onChange={handleChange}
/>,
);

const slider = getByRole('slider');
const slider = screen.getByRole('slider');
expect(slider).to.have.attribute('aria-valuenow', '10');

act(() => {
Expand Down

0 comments on commit ef2463f

Please sign in to comment.