Skip to content

Commit

Permalink
[joy-ui][Autocomplete] Fix spread key error in test (#42775)
Browse files Browse the repository at this point in the history
  • Loading branch information
aarongarciah authored and web-flow committed Jun 27, 2024
1 parent ff61ec3 commit 704cb5c
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 704cb5c

Please sign in to comment.