@@ -12,7 +12,7 @@ describe('useScrollToElement', () => {
1212
1313 beforeEach ( ( ) => {
1414 navigationState = { } ;
15-
15+
1616 mockElement = {
1717 scrollTop : 0 ,
1818 scrollLeft : 0 ,
@@ -37,7 +37,10 @@ describe('useScrollToElement', () => {
3737
3838 // Should restore scroll position on mount if saved state exists
3939 navigationState . sidebar = { x : 100 , y : 200 } ;
40- const { unmount : unmount1 } = renderHook ( ( ) => useScrollToElement ( 'sidebar' , mockRef ) , { wrapper } ) ;
40+ const { unmount : unmount1 } = renderHook (
41+ ( ) => useScrollToElement ( 'sidebar' , mockRef ) ,
42+ { wrapper }
43+ ) ;
4144
4245 assert . equal ( mockElement . scroll . mock . callCount ( ) , 1 ) ;
4346 assert . deepEqual ( mockElement . scroll . mock . calls [ 0 ] . arguments , [
@@ -50,7 +53,10 @@ describe('useScrollToElement', () => {
5053
5154 // Should not restore if no saved state exists
5255 navigationState = { } ;
53- const { unmount : unmount2 } = renderHook ( ( ) => useScrollToElement ( 'sidebar' , mockRef ) , { wrapper } ) ;
56+ const { unmount : unmount2 } = renderHook (
57+ ( ) => useScrollToElement ( 'sidebar' , mockRef ) ,
58+ { wrapper }
59+ ) ;
5460 assert . equal ( mockElement . scroll . mock . callCount ( ) , 0 ) ;
5561
5662 unmount2 ( ) ;
@@ -60,7 +66,10 @@ describe('useScrollToElement', () => {
6066 // Should not restore if current position matches saved state
6167 navigationState . sidebar = { x : 0 , y : 0 } ;
6268 mockElement . scrollTop = 0 ;
63- const { unmount : unmount3 } = renderHook ( ( ) => useScrollToElement ( 'sidebar' , mockRef ) , { wrapper } ) ;
69+ const { unmount : unmount3 } = renderHook (
70+ ( ) => useScrollToElement ( 'sidebar' , mockRef ) ,
71+ { wrapper }
72+ ) ;
6473 assert . equal ( mockElement . scroll . mock . callCount ( ) , 0 ) ;
6574
6675 unmount3 ( ) ;
@@ -86,9 +95,13 @@ describe('useScrollToElement', () => {
8695 ) ;
8796
8897 // First render: user scrolls to position 800
89- const { unmount } = renderHook ( ( ) => useScrollToElement ( 'sidebar' , mockRef ) , { wrapper } ) ;
98+ const { unmount } = renderHook (
99+ ( ) => useScrollToElement ( 'sidebar' , mockRef ) ,
100+ { wrapper }
101+ ) ;
90102
91- const scrollHandler = mockElement . addEventListener . mock . calls [ 0 ] . arguments [ 1 ] ;
103+ const scrollHandler =
104+ mockElement . addEventListener . mock . calls [ 0 ] . arguments [ 1 ] ;
92105 mockElement . scrollTop = 800 ;
93106 mockElement . scrollLeft = 0 ;
94107 scrollHandler ( ) ;
@@ -127,7 +140,8 @@ describe('useScrollToElement', () => {
127140 renderHook ( ( ) => useScrollToElement ( 'sidebar' , mockRef ) , { wrapper } ) ;
128141
129142 // Get the scroll handler that was registered
130- const scrollHandler2 = mockElement . addEventListener . mock . calls [ 0 ] . arguments [ 1 ] ;
143+ const scrollHandler2 =
144+ mockElement . addEventListener . mock . calls [ 0 ] . arguments [ 1 ] ;
131145
132146 // Simulate scroll
133147 mockElement . scrollTop = 150 ;
0 commit comments