Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Tests for onBlur and onFocus
  • Loading branch information
bruderstein committed Jul 27, 2015
commit 6c1a3274712a88d074439a67619e4a6983aed957
38 changes: 38 additions & 0 deletions test/Select-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1522,6 +1522,44 @@ describe('Select', function() {
expect(options[0], 'to have text', 'bbb');
});
});

describe('onBlur', function () {

var onBlur;

it('calls the onBlur prop when blurring the input', function () {

onBlur = sinon.spy();

instance = createControl({
options: defaultOptions,
onBlur: onBlur
});

TestUtils.Simulate.blur(searchInputNode);
expect(onBlur, 'was called once');
});
});

describe('onFocus', function () {

var onFocus;

beforeEach(function () {

onFocus = sinon.spy();

instance = createControl({
options: defaultOptions,
onFocus: onFocus
});
});

it('calls the onFocus prop when focusing the control', function () {

expect(onFocus, 'was called once');
});
});
});

describe('clicking outside', function () {
Expand Down