Skip to content

Commit

Permalink
add test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
shaodahong committed Mar 14, 2020
1 parent 9050c27 commit c27b2e1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions components/card/__tests__/index.test.js
Expand Up @@ -67,4 +67,22 @@ describe('Card', () => {
);
expect(wrapper.find('.ant-card-actions').length).toBe(0);
});

it('with tab props', () => {
const wrapper = mount(
<Card
title="Card title"
tabList={[
{
key: 'key',
tab: 'tab',
},
]}
tabProps={{ size: 'small' }}
>
<p>Card content</p>
</Card>,
);
expect(wrapper.find('Tabs').get(0).props.size).toBe('small');
});
});
2 changes: 1 addition & 1 deletion components/card/index.tsx
Expand Up @@ -165,9 +165,9 @@ export default class Card extends React.Component<CardProps, {}> {
const tabs =
tabList && tabList.length ? (
<Tabs
size="large"
{...extraProps}
className={`${prefixCls}-head-tabs`}
size="large"
onChange={this.onTabChange}
>
{tabList.map(item => (
Expand Down

0 comments on commit c27b2e1

Please sign in to comment.