Skip to content

Commit

Permalink
pass down className prop to card containers
Browse files Browse the repository at this point in the history
  • Loading branch information
lipp committed Feb 13, 2017
1 parent 565e267 commit 834ba30
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/js/card/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
*/

import React from 'react'
import classNames from 'classnames'

const container = (className) => ({children}) => (
<div className={className}>
const container = (name) => ({children, className}) => (
<div className={classNames(name, className)}>
{children}
</div>
)
Expand Down
5 changes: 5 additions & 0 deletions src/js/card/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,9 @@ describe('Card', () => {
const wrapper = shallow(<Title>some title</Title>)
assert.equal(wrapper.find('.Card-title').text(), 'some title')
})

it('should pass down className prop', () => {
const wrapper = shallow(<Card className='foo' />)
assert.equal(wrapper.find('.Card.foo').length, 1)
})
})

0 comments on commit 834ba30

Please sign in to comment.