Skip to content

Commit b61725c

Browse files
Fix custom className + regression test
Fixes Hacker0x01#153
1 parent 5042ba5 commit b61725c

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/date_input.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ var DateInput = React.createClass( {
8686
onFocus={this.props.onFocus}
8787
onBlur={this.props.onBlur}
8888
onChange={this.handleChange}
89-
className="datepicker__input"
89+
className={this.props.className}
9090
disabled={this.props.disabled}
9191
placeholder={this.props.placeholderText} />;
9292
}

test/date_input_test.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,12 @@ describe( "DateInput", function() {
2121

2222
expect( dateInput.disabled ).to.not.equal( null );
2323
} );
24+
25+
it( "uses a custom className if provided", function() {
26+
var dateInput = TestUtils.renderIntoDocument(
27+
<DateInput className="datepicker__custom-input" />
28+
);
29+
30+
expect( dateInput.getDOMNode().className ).to.equal( "datepicker__custom-input" );
31+
} );
2432
} );

0 commit comments

Comments
 (0)