Skip to content

Commit

Permalink
[InputBase] Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
hbjORbj committed Oct 28, 2021
1 parent 849706c commit be4ac50
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/mui-material/src/InputBase/InputBase.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,14 @@ describe('<InputBase />', () => {
const { container } = render(<InputBase inputProps={{ ref: inputRef }} />);
expect(inputRef.current).to.equal(container.querySelector('input'));
});

it('should not repeat the same classname', () => {
const { container } = render(<InputBase inputProps={{ className: 'foo' }} />);
const input = container.querySelector('input');
const matches = input.className.match(/foo/g);
expect(input).to.have.class('foo');
expect(matches).to.have.length(1);
});
});

describe('prop: inputComponent with prop: inputProps', () => {
Expand Down

0 comments on commit be4ac50

Please sign in to comment.