Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
hervedombya committed Jun 8, 2023
1 parent 40b9680 commit ad4b6da
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/lib/components/selectv2/selectv2.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -264,4 +264,14 @@ describe('SelectV2', () => {
container.querySelector('.sc-select__placeholder'),
).toHaveTextContent('Select...');
});

it('should not trigger onChange when defaultValue is empty string', () => {
const onChange = jest.fn();
render(
<Select value={''} onChange={onChange}>
<Option value="test">test</Option>
</Select>,
);
expect(onChange).toBeCalledTimes(0);
});
});

0 comments on commit ad4b6da

Please sign in to comment.