@@ -14,7 +14,7 @@ describe('LazyLoadImage', function() {
1414 afterLoad = ( ) => null ,
1515 beforeLoad = ( ) => null ,
1616 placeholder = null ,
17- scrollPosition = 0
17+ scrollPosition = { x : 0 , y : 0 }
1818 } = { } ) {
1919 return ReactTestUtils . renderIntoDocument (
2020 < LazyLoadImage
@@ -40,7 +40,7 @@ describe('LazyLoadImage', function() {
4040
4141 it ( 'renders the default placeholder when it\'s not in the viewport' , function ( ) {
4242 const lazyLoadImage = renderLazyLoadImage ( {
43- scrollPosition : - 1000
43+ scrollPosition : { x : 0 , y : - 1000 }
4444 } ) ;
4545
4646 expectImages ( lazyLoadImage , 0 ) ;
@@ -50,7 +50,7 @@ describe('LazyLoadImage', function() {
5050 it ( 'renders the prop placeholder when it\'s not in the viewport' , function ( ) {
5151 const placeholder = < span className = "test-placeholder" > </ span > ;
5252 const lazyLoadImage = renderLazyLoadImage ( {
53- scrollPosition : - 1000 ,
53+ scrollPosition : { x : 0 , y : - 1000 } ,
5454 placeholder
5555 } ) ;
5656
@@ -67,10 +67,10 @@ describe('LazyLoadImage', function() {
6767
6868 it ( 'renders the image when it appears in the viewport' , function ( ) {
6969 const lazyLoadImage = renderLazyLoadImage ( {
70- scrollPosition : - 1000
70+ scrollPosition : { x : 0 , y : - 1000 }
7171 } ) ;
7272
73- lazyLoadImage . componentWillReceiveProps ( { scrollPosition : 0 } ) ;
73+ lazyLoadImage . componentWillReceiveProps ( { scrollPosition : { x : 0 , y : 0 } } ) ;
7474
7575 expectImages ( lazyLoadImage , 1 ) ;
7676 expectPlaceholders ( lazyLoadImage , 0 ) ;
@@ -80,7 +80,7 @@ describe('LazyLoadImage', function() {
8080 const beforeLoad = jest . fn ( ) ;
8181 const lazyLoadImage = renderLazyLoadImage ( {
8282 beforeLoad,
83- scrollPosition : - 1000
83+ scrollPosition : { x : 0 , y : - 1000 }
8484 } ) ;
8585
8686 expect ( beforeLoad ) . toHaveBeenCalledTimes ( 0 ) ;
@@ -99,10 +99,10 @@ describe('LazyLoadImage', function() {
9999 const beforeLoad = jest . fn ( ) ;
100100 const lazyLoadImage = renderLazyLoadImage ( {
101101 beforeLoad,
102- scrollPosition : - 1000
102+ scrollPosition : { x : 0 , y : - 1000 }
103103 } ) ;
104104
105- lazyLoadImage . componentWillReceiveProps ( { scrollPosition : 0 } ) ;
105+ lazyLoadImage . componentWillReceiveProps ( { scrollPosition : { x : 0 , y : 0 } } ) ;
106106
107107 expect ( beforeLoad ) . toHaveBeenCalledTimes ( 1 ) ;
108108 } ) ;
@@ -111,7 +111,7 @@ describe('LazyLoadImage', function() {
111111 const afterLoad = jest . fn ( ) ;
112112 const lazyLoadImage = renderLazyLoadImage ( {
113113 afterLoad,
114- scrollPosition : - 1000
114+ scrollPosition : { x : 0 , y : - 1000 }
115115 } ) ;
116116
117117 expect ( afterLoad ) . toHaveBeenCalledTimes ( 0 ) ;
@@ -130,10 +130,10 @@ describe('LazyLoadImage', function() {
130130 const afterLoad = jest . fn ( ) ;
131131 const lazyLoadImage = renderLazyLoadImage ( {
132132 afterLoad,
133- scrollPosition : - 1000
133+ scrollPosition : { x : 0 , y : - 1000 }
134134 } ) ;
135135
136- lazyLoadImage . componentWillReceiveProps ( { scrollPosition : 0 } ) ;
136+ lazyLoadImage . componentWillReceiveProps ( { scrollPosition : { x : 0 , y : 0 } } ) ;
137137
138138 expect ( afterLoad ) . toHaveBeenCalledTimes ( 1 ) ;
139139 } ) ;
0 commit comments