@@ -19,7 +19,7 @@ const TestCase = (props) => {
19
19
} ;
20
20
export const FloatingButtonDriver = ( props : ComponentProps ) => {
21
21
const driver = useComponentDriver ( props ) ;
22
- const getStyle = ( ) => driver . getProps ( ) . style as ViewStyle ;
22
+ const getStyle = ( ) => driver . getElement ( ) . props . style as ViewStyle ;
23
23
return { ...driver , getStyle} ;
24
24
} ;
25
25
@@ -72,7 +72,7 @@ describe('FloatingButton', () => {
72
72
const renderTree = render ( < TestCase { ...props } /> ) ;
73
73
const buttonDriver = ButtonDriver ( { renderTree, testID : `${ TEST_ID } .button` } ) ;
74
74
75
- expect ( buttonDriver . getProps ( ) ? .style ?. marginBottom ) . toBe ( Spacings . s8 ) ;
75
+ expect ( buttonDriver . getElement ( ) . props . style ?. marginBottom ) . toBe ( Spacings . s8 ) ;
76
76
} ) ;
77
77
78
78
it ( 'should have default bottom margin for both buttons' , ( ) => {
@@ -81,16 +81,16 @@ describe('FloatingButton', () => {
81
81
const buttonDriver = ButtonDriver ( { renderTree, testID : `${ TEST_ID } .button` } ) ;
82
82
const buttonDriver2 = ButtonDriver ( { renderTree, testID : `${ TEST_ID } .secondaryButton` } ) ;
83
83
84
- expect ( buttonDriver . getProps ( ) ? .style ?. marginBottom ) . toBe ( Spacings . s4 ) ;
85
- expect ( buttonDriver2 . getProps ( ) ? .style ?. marginBottom ) . toBe ( Spacings . s7 ) ;
84
+ expect ( buttonDriver . getElement ( ) . props . style ?. marginBottom ) . toBe ( Spacings . s4 ) ;
85
+ expect ( buttonDriver2 . getElement ( ) . props . style ?. marginBottom ) . toBe ( Spacings . s7 ) ;
86
86
} ) ;
87
87
88
88
it ( 'should have bottom margin that match bottomMargin prop' , ( ) => {
89
89
const props = { visible : true , bottomMargin : 10 } ;
90
90
const renderTree = render ( < TestCase { ...props } /> ) ;
91
91
const buttonDriver = ButtonDriver ( { renderTree, testID : `${ TEST_ID } .button` } ) ;
92
92
93
- expect ( buttonDriver . getProps ( ) ? .style ?. marginBottom ) . toBe ( 10 ) ;
93
+ expect ( buttonDriver . getElement ( ) . props . style ?. marginBottom ) . toBe ( 10 ) ;
94
94
} ) ;
95
95
96
96
it ( 'should have bottom margin for secondary button that match bottomMarginProp' , ( ) => {
@@ -99,8 +99,8 @@ describe('FloatingButton', () => {
99
99
const buttonDriver = ButtonDriver ( { renderTree, testID : `${ TEST_ID } .button` } ) ;
100
100
const buttonDriver2 = ButtonDriver ( { renderTree, testID : `${ TEST_ID } .secondaryButton` } ) ;
101
101
102
- expect ( buttonDriver . getProps ( ) ? .style ?. marginBottom ) . toBe ( Spacings . s4 ) ;
103
- expect ( buttonDriver2 . getProps ( ) ? .style ?. marginBottom ) . toBe ( 10 ) ;
102
+ expect ( buttonDriver . getElement ( ) . props . style ?. marginBottom ) . toBe ( Spacings . s4 ) ;
103
+ expect ( buttonDriver2 . getElement ( ) . props . style ?. marginBottom ) . toBe ( 10 ) ;
104
104
} ) ;
105
105
} ) ;
106
106
0 commit comments