Skip to content

Commit

Permalink
added tests for fix JedWatson#1020 and JedWatson#2102
Browse files Browse the repository at this point in the history
  • Loading branch information
Sushant Kulkarni committed Dec 4, 2017
1 parent 25242fc commit 8396600
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions test/Select-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3172,6 +3172,36 @@ describe('Select', () => {
});
});

describe('option onBlur returns non false value', () => {
it('menu should be closed', () => {
instance = createControl({
options: defaultOptions,
onBlur: (e) => {
return true;
}
});

clickArrowToOpen();
instance.handleInputBlur();
expect( instance.state.isOpen, 'to be false');
});
});

describe('option onBlur returns false', () => {
it('menu must remain open', () => {
instance = createControl({
options: defaultOptions,
onBlur: (e) => {
return false;
}
});

clickArrowToOpen();
instance.handleInputBlur();
expect( instance.state.isOpen, 'to be true');
});
});

describe('onFocus', () => {

var onFocus;
Expand Down

0 comments on commit 8396600

Please sign in to comment.