Skip to content

Commit

Permalink
test: add test case for verticalAlign prop
Browse files Browse the repository at this point in the history
  • Loading branch information
micate committed Jun 15, 2018
1 parent 868e1f8 commit 2bd41c9
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions tests/CheckboxGroup.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,14 @@ function renderWithProps(someProps) {
{ value: 'sea', text: '大海' },
];
assign(props, someProps);
const CheckboxGroupItems = items.map(v => (
<CheckboxGroupItem disabled={v.disabled} value={v.value} text={v.text} />
const CheckboxGroupItems = items.map((v, i) => (
<CheckboxGroupItem
disabled={v.disabled}
value={v.value}
text={v.text}
addon={'addon'}
showAddonWhenChecked={i % 2 === 0}
/>
));
const wrapper = mount(<CheckboxGroup {...props}>
{CheckboxGroupItems}
Expand Down Expand Up @@ -90,6 +96,13 @@ describe('CheckboxGroup', () => {
expect(wrapper.find('.kuma-checkbox-group-item').length).to.be(4);
done();
});
it('should render verticalAlign correctly', (done) => {
const wrapper = renderWithProps({
verticalAlign: true,
});
expect(wrapper.find('.kuma-checkbox-group-row').length).to.be(4);
done();
});
});

describe('control', () => {
Expand Down

0 comments on commit 2bd41c9

Please sign in to comment.