Skip to content

Commit

Permalink
refactor(unorderedlist): rearrange props
Browse files Browse the repository at this point in the history
- adjust box docs
- remove unused box tests
  • Loading branch information
theetrain committed Nov 7, 2017
1 parent f9a1036 commit 16cf678
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 38 deletions.
2 changes: 1 addition & 1 deletion src/components/Box/Box.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ When wrapping a Box element around a series of elements, use the `between` prop

```jsx
<Box inline between={3}>
<Link href="//telus.com">Go to TELUS.com</Link>
<Link href="//telus.com">Home</Link>
<Link href="//telus.com">Shop</Link>
<Link href="//telus.com">My Account</Link>
<Link href="//telus.com">Support</Link>
Expand Down
36 changes: 0 additions & 36 deletions src/components/Box/__tests__/Box.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,6 @@ import { shallow } from 'enzyme'

import Box from '../Box'

describe.skip('Box deprecated', () => {
const defaultProps = {
spacing: 'padding',
vertical: 2,
}

const doShallow = (props = {}) =>
shallow(
<Box {...defaultProps} {...props}>
Some content
</Box>
)

it('can have padding or margin', () => {
let box = doShallow({ spacing: 'padding', all: 1 })
expect(box).toHaveClassName('allPadding-1')

box = doShallow({ spacing: 'margin', all: 1 })
expect(box).toHaveClassName('allMargin-1')
})

it('can have directional spacing', () => {
let box = doShallow({ spacing: 'padding', top: 1 })
expect(box).toHaveClassName('topPadding-1')

box = doShallow({ spacing: 'padding', top: 1, right: 2 })
expect(box).toHaveClassName('topPadding-1 rightPadding-2')

box = doShallow({ spacing: 'padding', top: 1, right: 2, bottom: 3 })
expect(box).toHaveClassName('topPadding-1 rightPadding-2 bottomPadding-3')

box = doShallow({ spacing: 'padding', top: 1, right: 2, bottom: 3, left: 4 })
expect(box).toHaveClassName('topPadding-1 rightPadding-2 bottomPadding-3 leftPadding-4')
})
})

describe('Box', () => {
const doShallow = (props = {}) => shallow(<Box {...props}>Some content</Box>)

Expand Down
2 changes: 1 addition & 1 deletion src/components/Lists/UnorderedList/UnorderedList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const injectListStyle = (child, listStyle) => React.cloneElement(child, { listSt

const UnorderedList = ({ listStyle, children, ...rest }) => {
return (
<Box tag="ul" between={2} {...safeRest(rest)} dangerouslyAddClassName={styles.base}>
<Box {...safeRest(rest)} tag="ul" between={2} dangerouslyAddClassName={styles.base}>
{React.Children.map(children, child => injectListStyle(child, listStyle))}
</Box>
)
Expand Down

0 comments on commit 16cf678

Please sign in to comment.