[inputs] Remove deprecated props & classes by mj12albert · Pull Request #48071 · mui/material-ui (original) (raw)

@mj12albert

@mj12albert mj12albert changed the title[inputs] Remove deprecated props [inputs] Remove deprecated props & classes

Mar 23, 2026

@mui-bot

@mj12albert

siriwatknp

Comment on lines -57 to -61

it('should respects the componentsProps if passed', () => {
render(<FilledInput componentsProps={{ root: { 'data-test': 'test' } }} />);
expect(document.querySelector('[data-test=test]')).not.to.equal(null);
});

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better convert this to slotProps than removing test?

siriwatknp

siriwatknp

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments

silviuaavram

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some test related comments

Comment on lines -38 to -42

it('should respects the componentsProps if passed', () => {
render(<Input componentsProps={{ root: { 'data-test': 'test' } }} />);
expect(document.querySelector('[data-test=test]')).not.to.equal(null);
});

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, convert test to slotProps equivalent

,
);
expect(container.querySelector('input')).to.have.class(classes.inputSizeSmall);
expect(screen.getByTestId('root')).to.have.class(classes.sizeSmall);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we also check input has class input? when migrating these, I usually check for the equivalents, and in this case, the equivalent also involves input class.

const { container, setProps } = render();
expect(container.querySelector('input')).not.to.have.class(classes.inputSizeSmall);
const { setProps } = render();
expect(screen.getByTestId('root')).not.to.have.class(classes.sizeSmall);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, check root small and input input

expect(container.querySelector('input')).to.have.class(classes.inputSizeSmall);
});
it('has an inputHiddenLabel class to further reduce margin', () => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe convert this test instead of removing it? check input + hiddenLabel

expect(document.querySelector('.error')).not.to.equal(null);
});
it('should respects the componentsProps if passed', () => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same nere

/>,
);
expect(screen.getByTestId('mui-input-base-root')).to.have.class(inputBaseClasses.multiline);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's also check the input has class input

@mj12albert

@mj12albert

Added back all the tests dropped by Claude code 🤡

@mj12albert

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})