Skip to content

Commit

Permalink
duplicate getOptionLabel contract unit test in Joy UI
Browse files Browse the repository at this point in the history
  • Loading branch information
rangoo94 committed Feb 13, 2023
1 parent 761d3e0 commit 4859534
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions packages/mui-joy/src/Autocomplete/Autocomplete.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1975,6 +1975,25 @@ describe('Joy <Autocomplete />', () => {
});
expect(textbox).to.have.property('value', 'a');
});

it('should not throw error when nested options are provided', () => {
const { getByRole } = render(
<Autocomplete
openOnFocus
autoHighlight
options={[
{ property: { name: 'one' } },
{ property: { name: 'two' } },
{ property: { name: 'three' } },
]}
getOptionLabel={(option) => option.property.name}
/>,
);

expect(() => {
fireEvent.focus(getByRole('combobox'));
}).not.to.throw();
});
});

describe('prop: onHighlightChange', () => {
Expand Down

0 comments on commit 4859534

Please sign in to comment.