Skip to content

Commit

Permalink
add test to ensure <Combobox nullable /> doesn't crash
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinMalfait committed Apr 15, 2024
1 parent 90c09fe commit 1e6c815
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,31 @@ describe('Rendering', () => {
assertComboboxList({ state: ComboboxState.InvisibleUnmounted })
})
)

it(
'should not crash when the `Combobox` still contains a `nullable` prop',
suppressConsoleLogs(async () => {
let data = [
{ id: 1, name: 'alice', label: 'Alice' },
{ id: 2, name: 'bob', label: 'Bob' },
{ id: 3, name: 'charlie', label: 'Charlie' },
]

render(
<Combobox nullable>
<Combobox.Input onChange={NOOP} />
<Combobox.Button />
<Combobox.Options>
{data.map((person) => (
<Combobox.Option key={person.id} value={person}>
{person.label}
</Combobox.Option>
))}
</Combobox.Options>
</Combobox>
)
})
)
})

describe('Combobox.Input', () => {
Expand Down

0 comments on commit 1e6c815

Please sign in to comment.