@@ -24,7 +24,6 @@ const refs = (o = {}) => ({
2424 topRef : { current : o . top === null ? null : el ( { offsetTop : 10 , ...o . top } ) } ,
2525 topLeftColRef : { current : el ( { offsetHeight : 50 , offsetWidth : 200 , ...o . topLeftCol } ) } ,
2626 topRightColRef : { current : el ( { offsetHeight : 40 , offsetWidth : 180 , ...o . topRightCol } ) } ,
27- insetRef : { current : o . inset === null ? null : el ( { offsetHeight : 100 , offsetLeft : 20 , offsetWidth : 300 , ...o . inset } ) } ,
2827 footerRef : { current : o . footer === null ? null : el ( { offsetTop : 400 , ...o . footer } ) } ,
2928 actionsRef : { current : el ( { offsetTop : 450 , ...o . actions } ) } ,
3029 leftTopRef : { current : el ( { offsetHeight : 0 , ...o . leftTop } ) } ,
@@ -57,7 +56,7 @@ describe('useLayoutMeasurements', () => {
5756 } )
5857
5958 test ( 'early return when required refs are null' , ( ) => {
60- const { layoutRefs } = setup ( { refs : { main : null , top : null , inset : null , footer : null } } )
59+ const { layoutRefs } = setup ( { refs : { main : null , top : null , footer : null } } )
6160 renderHook ( ( ) => useLayoutMeasurements ( ) )
6261 expect ( layoutRefs . appContainerRef . current . style . setProperty ) . not . toHaveBeenCalled ( )
6362 } )
@@ -66,13 +65,11 @@ describe('useLayoutMeasurements', () => {
6665 const { layoutRefs } = setup ( )
6766 renderHook ( ( ) => useLayoutMeasurements ( ) )
6867 const spy = layoutRefs . appContainerRef . current . style . setProperty
69- ; [ '--offset-left' , '-- right-offset-top', '--right-offset-bottom' , '--top-col-width' ]
68+ ; [ '--right-offset-top' , '--right-offset-bottom' , '--top-col-width' ]
7069 . forEach ( prop => expect ( spy ) . toHaveBeenCalledWith ( prop , expect . any ( String ) ) )
7170 } )
7271
7372 test . each ( [
74- [ 'offset-left with overlap' , { inset : { offsetHeight : 200 , offsetLeft : 30 , offsetWidth : 150 } , footer : { offsetTop : 100 } , actions : { offsetTop : 120 } , topLeftCol : { offsetHeight : 50 } , top : { offsetTop : 10 } } , '180px' ] ,
75- [ 'offset-left without overlap' , { inset : { offsetHeight : 50 , offsetLeft : 30 , offsetWidth : 150 } , footer : { offsetTop : 200 } , actions : { offsetTop : 220 } , topLeftCol : { offsetHeight : 50 } , top : { offsetTop : 10 } } , '0px' ] ,
7673 [ 'right-offset-top' , { topRightCol : { offsetHeight : 80 } , top : { offsetTop : 15 } } , '95px' ] ,
7774 [ 'right-offset-bottom' , { main : { offsetHeight : 600 } , footer : { offsetTop : 500 } } , '108px' ] ,
7875 // leftColumnHeight = 400 - (50+10) - 8 = 332; rightColumnHeight = 400 - (40+10) - 8 = 342
0 commit comments