Skip to content

Commit

Permalink
Adjust tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Rall3n committed Oct 18, 2021
1 parent 5f445b5 commit 4ce20e3
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/react-select/src/__tests__/Select.test.tsx
Expand Up @@ -1290,7 +1290,10 @@ cases(
keyCode: 27,
key: 'Escape',
});
expect(spy).toHaveBeenCalledWith('', { action: 'menu-close' });
expect(spy).toHaveBeenCalledWith('', {
action: 'menu-close',
currentValue: 'test',
});
},
{
'single select > should call onInputChange prop with empty string as inputValue':
Expand Down Expand Up @@ -3013,9 +3016,13 @@ test('close menu on hitting escape and clear input value if menu is open even if
expect(onMenuCloseSpy).toHaveBeenCalled();
// once by onMenuClose and other is direct
expect(onInputChangeSpy).toHaveBeenCalledTimes(2);
expect(onInputChangeSpy).toHaveBeenCalledWith('', { action: 'menu-close' });
expect(onInputChangeSpy).toHaveBeenCalledWith('', {
action: 'menu-close',
currentValue: '',
});
expect(onInputChangeSpy).toHaveBeenLastCalledWith('', {
action: 'menu-close',
currentValue: '',
});
});

Expand Down

0 comments on commit 4ce20e3

Please sign in to comment.