File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed
packages/core/src/WingBlank Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ export default class WingBlank extends Component<WingBlankProps> {
2020 } else if ( size && styles [ size ] ) {
2121 sizeStyle = styles [ size ] ;
2222 }
23- return < View { ...restProps } style = { [ sizeStyle , style ] } /> ;
23+ return < View testID = "RNE__WingBlank__view" { ...restProps } style = { [ sizeStyle , style ] } /> ;
2424 }
2525}
2626
Original file line number Diff line number Diff line change 1+ import 'react-native' ;
2+ import React from 'react' ;
3+ import WingBlank from '../lib/WingBlank' ;
4+ import { render } from '@testing-library/react-native' ;
5+ import { keys , toObject } from '../utils' ;
6+
7+ const SIZE : keys = {
8+ small : 6 ,
9+ default : 12 ,
10+ large : 16 ,
11+ } ;
12+
13+ describe ( 'WingBlank' , ( ) => {
14+ describe . each `
15+ size
16+ ${ 'small' }
17+ ${ 'default' }
18+ ${ 'large' }
19+ ` ( '$size' , ( { size } ) => {
20+ it ( `should display size ${ size } wingBlank` , ( ) => {
21+ const { getByTestId } = render ( < WingBlank size = { size } /> ) ;
22+ const component = getByTestId ( 'RNE__WingBlank__view' ) ;
23+ const styles = toObject ( component . props . style ) ;
24+ expect ( styles . marginHorizontal ) . toBe ( SIZE [ size ] ) ;
25+ } ) ;
26+ } ) ;
27+ } ) ;
You can’t perform that action at this time.
0 commit comments