Skip to content

Commit

Permalink
fix: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Loïc Mangeonjean committed Feb 29, 2024
1 parent 112902e commit 6e95b0b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/mui-joy/src/Autocomplete/Autocomplete.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1391,7 +1391,12 @@ describe('Joy <Autocomplete />', () => {

it('should keep focus on selected option when options updates and when options are provided as objects', () => {
const { setProps } = render(
<Autocomplete open options={[{ label: 'one' }, { label: 'two' }]} autoFocus />,
<Autocomplete
open
options={[{ label: 'one' }, { label: 'two' }]}
autoFocus
isOptionEqualToValue={(a, b) => a.label === b.label}
/>,
);
const textbox = screen.getByRole('combobox');
const listbox = screen.getByRole('listbox');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1825,6 +1825,7 @@ describe('<Autocomplete />', () => {
open
options={[{ label: 'one' }, { label: 'two' }]}
renderInput={(params) => <TextField {...params} autoFocus />}
isOptionEqualToValue={(a, b) => a.label === b.label}
/>,
);
const textbox = screen.getByRole('combobox');
Expand Down

0 comments on commit 6e95b0b

Please sign in to comment.