Skip to content

Commit

Permalink
DownshiftSelect: Test click clear calls onSelectedItemChange with null
Browse files Browse the repository at this point in the history
  • Loading branch information
marco committed Apr 29, 2021
1 parent 06f329a commit 9838c25
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Input/DownshiftSelect/Select.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -412,12 +412,15 @@ describe('<Select> (Downshift)', () => {

it('should call the onClear callback', () => {
const onClear = jest.fn();
const onSelectedItemChange = jest.fn();
const { getClearButton } = renderSelect({
onClear,
onSelectedItemChange,
selectedItem: first(items),
});
fireEvent.click(getClearButton());
expect(onClear).toHaveBeenCalledTimes(1);
expect(onSelectedItemChange).toHaveBeenCalledWith(null);
});

it('should allow configuration of empty list text', () => {
Expand Down

0 comments on commit 9838c25

Please sign in to comment.