Skip to content

Commit

Permalink
[joy-ui][Autocomplete] Fix spread key error in test (mui#42775)
Browse files Browse the repository at this point in the history
  • Loading branch information
aarongarciah authored and joserodolfofreitas committed Jul 29, 2024
1 parent c192cad commit 7a70a72
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions packages/mui-joy/src/Autocomplete/Autocomplete.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -480,11 +480,14 @@ describe('Joy <Autocomplete />', () => {
renderTags={(value, getTagProps) =>
value
.filter((x, index) => index === 1)
.map((option, index) => (
<Chip key={index} endDecorator={<ChipDelete {...getTagProps({ index })} />}>
{option.title}
</Chip>
))
.map((option, index) => {
const { key, ...tagProps } = getTagProps({ index });
return (
<Chip key={index} endDecorator={<ChipDelete key={key} {...tagProps} />}>
{option.title}
</Chip>
);
})
}
onChange={handleChange}
autoFocus
Expand Down

0 comments on commit 7a70a72

Please sign in to comment.