@@ -161,7 +161,7 @@ describe('fireEvent.changeText', () => {
161161 const input = screen . getByTestId ( 'input' ) ;
162162 await fireEvent . changeText ( input , 'new text' ) ;
163163 expect ( onChangeText ) . toHaveBeenCalledWith ( 'new text' ) ;
164- expect ( nativeState . valueForElement . get ( input ) ) . toBe ( 'new text' ) ;
164+ expect ( nativeState . valueForInstance . get ( input ) ) . toBe ( 'new text' ) ;
165165 } ) ;
166166
167167 test ( 'does not fire on non-editable TextInput' , async ( ) => {
@@ -170,7 +170,7 @@ describe('fireEvent.changeText', () => {
170170 const input = screen . getByTestId ( 'input' ) ;
171171 await fireEvent . changeText ( input , 'new text' ) ;
172172 expect ( onChangeText ) . not . toHaveBeenCalled ( ) ;
173- expect ( nativeState . valueForElement . get ( input ) ) . toBeUndefined ( ) ;
173+ expect ( nativeState . valueForInstance . get ( input ) ) . toBeUndefined ( ) ;
174174 } ) ;
175175} ) ;
176176
@@ -286,7 +286,7 @@ describe('fireEvent.scroll', () => {
286286 const scrollView = screen . getByTestId ( 'scroll' ) ;
287287 await fireEvent . scroll ( scrollView , verticalScrollEvent ) ;
288288 expect ( onScroll . mock . calls [ 0 ] [ 0 ] ) . toMatchObject ( verticalScrollEvent ) ;
289- expect ( nativeState . contentOffsetForElement . get ( scrollView ) ) . toEqual ( { x : 0 , y : 200 } ) ;
289+ expect ( nativeState . contentOffsetForInstance . get ( scrollView ) ) . toEqual ( { x : 0 , y : 200 } ) ;
290290 } ) ;
291291
292292 test . each ( [
@@ -301,7 +301,7 @@ describe('fireEvent.scroll', () => {
301301 const scrollView = screen . getByTestId ( 'scroll' ) ;
302302 await fireEvent ( scrollView , eventName , verticalScrollEvent ) ;
303303 expect ( handler ) . toHaveBeenCalledWith ( verticalScrollEvent ) ;
304- expect ( nativeState . contentOffsetForElement . get ( scrollView ) ) . toEqual ( { x : 0 , y : 200 } ) ;
304+ expect ( nativeState . contentOffsetForInstance . get ( scrollView ) ) . toEqual ( { x : 0 , y : 200 } ) ;
305305 } ) ;
306306
307307 test ( 'without contentOffset scrolls to (0, 0)' , async ( ) => {
@@ -316,7 +316,7 @@ describe('fireEvent.scroll', () => {
316316 expect ( onScroll . mock . calls [ 0 ] [ 0 ] ) . toMatchObject ( {
317317 nativeEvent : { contentOffset : { x : 0 , y : 0 } } ,
318318 } ) ;
319- expect ( nativeState . contentOffsetForElement . get ( scrollView ) ) . toEqual ( { x : 0 , y : 0 } ) ;
319+ expect ( nativeState . contentOffsetForInstance . get ( scrollView ) ) . toEqual ( { x : 0 , y : 0 } ) ;
320320 } ) ;
321321
322322 test ( 'with non-finite contentOffset values uses 0' , async ( ) => {
@@ -331,7 +331,7 @@ describe('fireEvent.scroll', () => {
331331 nativeEvent : { contentOffset : { y : Infinity } } ,
332332 } ) ;
333333 expect ( onScroll ) . toHaveBeenCalled ( ) ;
334- expect ( nativeState . contentOffsetForElement . get ( scrollView ) ) . toEqual ( { x : 0 , y : 0 } ) ;
334+ expect ( nativeState . contentOffsetForInstance . get ( scrollView ) ) . toEqual ( { x : 0 , y : 0 } ) ;
335335 } ) ;
336336
337337 test ( 'with horizontal scroll updates native state' , async ( ) => {
@@ -344,7 +344,7 @@ describe('fireEvent.scroll', () => {
344344 const scrollView = screen . getByTestId ( 'scroll' ) ;
345345 await fireEvent . scroll ( scrollView , horizontalScrollEvent ) ;
346346 expect ( onScroll . mock . calls [ 0 ] [ 0 ] ) . toMatchObject ( horizontalScrollEvent ) ;
347- expect ( nativeState . contentOffsetForElement . get ( scrollView ) ) . toEqual ( { x : 50 , y : 0 } ) ;
347+ expect ( nativeState . contentOffsetForInstance . get ( scrollView ) ) . toEqual ( { x : 50 , y : 0 } ) ;
348348 } ) ;
349349
350350 test ( 'without contentOffset via fireEvent() does not update native state' , async ( ) => {
@@ -357,7 +357,7 @@ describe('fireEvent.scroll', () => {
357357 const scrollView = screen . getByTestId ( 'scroll' ) ;
358358 await fireEvent ( scrollView , 'scroll' , { nativeEvent : { } } ) ;
359359 expect ( onScroll ) . toHaveBeenCalled ( ) ;
360- expect ( nativeState . contentOffsetForElement . get ( scrollView ) ) . toBeUndefined ( ) ;
360+ expect ( nativeState . contentOffsetForInstance . get ( scrollView ) ) . toBeUndefined ( ) ;
361361 } ) ;
362362
363363 test ( 'with non-finite x contentOffset value uses 0' , async ( ) => {
@@ -372,7 +372,7 @@ describe('fireEvent.scroll', () => {
372372 nativeEvent : { contentOffset : { x : Infinity } } ,
373373 } ) ;
374374 expect ( onScroll ) . toHaveBeenCalled ( ) ;
375- expect ( nativeState . contentOffsetForElement . get ( scrollView ) ) . toEqual ( { x : 0 , y : 0 } ) ;
375+ expect ( nativeState . contentOffsetForInstance . get ( scrollView ) ) . toEqual ( { x : 0 , y : 0 } ) ;
376376 } ) ;
377377} ) ;
378378
0 commit comments