Skip to content

Commit

Permalink
test(ComboBox): update upon new internal API
Browse files Browse the repository at this point in the history
  • Loading branch information
asudoh committed Aug 5, 2019
1 parent a566b61 commit fa146e9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/react/src/components/ComboBox/ComboBox-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const downshiftActions = {
setHighlightedIndex: jest.fn(),
};
const clearInput = wrapper =>
wrapper.instance().handleOnInputValueChange('', downshiftActions);
wrapper.instance().handleOnStateChange({ inputValue: '' }, downshiftActions);

describe('ComboBox', () => {
let mockProps;
Expand Down Expand Up @@ -156,10 +156,14 @@ describe('ComboBox', () => {
it('should set `inputValue` to an empty string if a falsey-y value is given', () => {
const wrapper = mount(<ComboBox {...mockProps} />);

wrapper.instance().handleOnInputValueChange('foo', downshiftActions);
wrapper
.instance()
.handleOnStateChange({ inputValue: 'foo' }, downshiftActions);
expect(wrapper.state('inputValue')).toBe('foo');

wrapper.instance().handleOnInputValueChange(null, downshiftActions);
wrapper
.instance()
.handleOnStateChange({ inputValue: null }, downshiftActions);
expect(wrapper.state('inputValue')).toBe('');
});
});
Expand Down

0 comments on commit fa146e9

Please sign in to comment.