Skip to content

Commit

Permalink
fix(select): className option is passed to select and overrides selec…
Browse files Browse the repository at this point in the history
…tClassName (#872)
  • Loading branch information
gugu authored and Matt Goo committed May 30, 2019
1 parent 40ca635 commit 6e2aac1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/select/index.tsx
Expand Up @@ -343,6 +343,7 @@ export default class Select<
const {
selectClassName,
/* eslint-disable */
className,
floatingLabelClassName,
lineRippleClassName,
notchedOutlineClassName,
Expand Down
10 changes: 10 additions & 0 deletions test/unit/select/index.test.tsx
Expand Up @@ -403,6 +403,16 @@ test('renders BaseSelect for select', () => {
);
});

test('does not pass className to BaseSelect', () => {
const wrapper = shallow(<Select label='my label' className="container-class" />);
assert.equal(wrapper.childAt(0).childAt(1).prop('className'), "");
});

test('pass selectClassName to BaseSelect', () => {
const wrapper = shallow(<Select label='my label' selectClassName="select-class" />);
assert.equal(wrapper.childAt(0).childAt(1).prop('className'), "select-class");
});

test('renders FloatingLabel after BaseSelect if props.label exists', () => {
const wrapper = shallow(<Select label='my label' />);
assert.equal(
Expand Down

0 comments on commit 6e2aac1

Please sign in to comment.