File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,11 @@ describe('Button', () => {
3333 expect ( container . firstChild ) . toHaveClass ( 'custom-class' ) ;
3434 } ) ;
3535
36+ it ( 'applies size className' , ( ) => {
37+ const { container } = render ( < Button size = "small" > Test</ Button > ) ;
38+ expect ( container . firstChild ) . toHaveClass ( 'ant-btn-sm' ) ;
39+ } ) ;
40+
3641 it ( 'passes other props to AntdButton' , ( ) => {
3742 const { getByText } = render ( < Button type = "primary" > Primary</ Button > ) ;
3843 expect ( getByText ( 'Primary' ) . parentNode ) . toHaveClass ( 'ant-btn-primary' ) ;
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ export default function Button({
1414 ...rest
1515} : ButtonProps ) {
1616 return (
17- < AntdButton className = { classNames ( 'dtc-button' , className ) } { ...rest } >
17+ < AntdButton className = { classNames ( 'dtc-button' , className ) } size = { size } { ...rest } >
1818 { icon && < span className = { `dtc-button__icon dtc-button__icon--${ size } ` } > { icon } </ span > }
1919 { children && (
2020 < span className = { `dtc-button__text dtc-button__text--${ size } ` } > { children } </ span >
You can’t perform that action at this time.
0 commit comments