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
Test for className prop
  • Loading branch information
bruderstein committed Jul 27, 2015
commit 30e20f04d04998cb067e1bc4725ef35ac10ac1b7
41 changes: 41 additions & 0 deletions test/Select-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -804,4 +804,45 @@ describe('Select', function() {

});

describe('with props', function () {

var defaultOptions = [
{ value: 'one', label: 'One' },
{ value: 'two', label: '222' },
{ value: 'three', label: 'Three' },
{ value: 'four', label: 'AbcDef' }
];

var createControl = function(props) {


onChange = sinon.spy();
// Render an instance of the component
instance = TestUtils.renderIntoDocument(
<Select
onChange={onChange}
{...props}
/>
);

// Focus on the input, such that mouse events are accepted
searchInputNode = instance.getInputNode().getDOMNode().querySelector('input');
TestUtils.Simulate.focus(searchInputNode);
return instance;

};

describe('className', function () {

it('assigns the className to the outer-most element', function () {

var instance = createControl({ className: 'test-class' });
expect(React.findDOMNode(instance), 'to have attributes', {
class: 'test-class'
});
});
});

});

});