Skip to content

Commit

Permalink
Add test for disableOptionEqualToValueWarning
Browse files Browse the repository at this point in the history
  • Loading branch information
grzegorz-jazurek committed Feb 22, 2023
1 parent 9c19a9a commit 57d0a02
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/mui-material/src/Autocomplete/Autocomplete.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1534,6 +1534,22 @@ describe('<Autocomplete />', () => {
]);
});

it('skip warn if value does not exist in options list and disableOptionEqualToValueWarning is true', () => {
const value = 'value outside of options';
const options = ['val from previous server fetch'];

expect(() => {
render(
<Autocomplete
value={value}
options={options}
renderInput={(params) => <TextField {...params} />}
disableOptionEqualToValueWarning
/>,
);
}).not.toWarnDev();
});

it('warn if groups options are not sorted', () => {
const data = [
{ group: 1, value: 'A' },
Expand Down

0 comments on commit 57d0a02

Please sign in to comment.