@@ -19,7 +19,7 @@ const TestCase = (props) => {
1919} ;
2020export const FloatingButtonDriver = ( props : ComponentProps ) => {
2121 const driver = useComponentDriver ( props ) ;
22- const getStyle = ( ) => driver . getProps ( ) . style as ViewStyle ;
22+ const getStyle = ( ) => driver . getElement ( ) . props . style as ViewStyle ;
2323 return { ...driver , getStyle} ;
2424} ;
2525
@@ -72,7 +72,7 @@ describe('FloatingButton', () => {
7272 const renderTree = render ( < TestCase { ...props } /> ) ;
7373 const buttonDriver = ButtonDriver ( { renderTree, testID : `${ TEST_ID } .button` } ) ;
7474
75- expect ( buttonDriver . getProps ( ) ? .style ?. marginBottom ) . toBe ( Spacings . s8 ) ;
75+ expect ( buttonDriver . getElement ( ) . props . style ?. marginBottom ) . toBe ( Spacings . s8 ) ;
7676 } ) ;
7777
7878 it ( 'should have default bottom margin for both buttons' , ( ) => {
@@ -81,16 +81,16 @@ describe('FloatingButton', () => {
8181 const buttonDriver = ButtonDriver ( { renderTree, testID : `${ TEST_ID } .button` } ) ;
8282 const buttonDriver2 = ButtonDriver ( { renderTree, testID : `${ TEST_ID } .secondaryButton` } ) ;
8383
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 ) ;
8686 } ) ;
8787
8888 it ( 'should have bottom margin that match bottomMargin prop' , ( ) => {
8989 const props = { visible : true , bottomMargin : 10 } ;
9090 const renderTree = render ( < TestCase { ...props } /> ) ;
9191 const buttonDriver = ButtonDriver ( { renderTree, testID : `${ TEST_ID } .button` } ) ;
9292
93- expect ( buttonDriver . getProps ( ) ? .style ?. marginBottom ) . toBe ( 10 ) ;
93+ expect ( buttonDriver . getElement ( ) . props . style ?. marginBottom ) . toBe ( 10 ) ;
9494 } ) ;
9595
9696 it ( 'should have bottom margin for secondary button that match bottomMarginProp' , ( ) => {
@@ -99,8 +99,8 @@ describe('FloatingButton', () => {
9999 const buttonDriver = ButtonDriver ( { renderTree, testID : `${ TEST_ID } .button` } ) ;
100100 const buttonDriver2 = ButtonDriver ( { renderTree, testID : `${ TEST_ID } .secondaryButton` } ) ;
101101
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 ) ;
104104 } ) ;
105105 } ) ;
106106
0 commit comments