@@ -2,7 +2,7 @@ import React from 'react';
22import { shallow } from 'enzyme' ;
33import { Utils } from 'manifesto.js' ;
44import Chip from '@material-ui/core/Chip' ;
5- import IntersectionObserver from '@researchgate/ react-intersection-observer' ;
5+ import { InView } from 'react-intersection-observer' ;
66import manifestJson from '../../fixtures/version-2/019.json' ;
77import { GalleryViewThumbnail } from '../../../src/components/GalleryViewThumbnail' ;
88import IIIFThumbnail from '../../../src/containers/IIIFThumbnail' ;
@@ -78,7 +78,7 @@ describe('GalleryView', () => {
7878 } ;
7979 wrapper = createWrapper ( { annotationsCount : 0 , canvas, requestCanvasAnnotations } ) ;
8080
81- wrapper . find ( IntersectionObserver ) . simulate ( 'change' , { isIntersecting : true } ) ;
81+ wrapper . find ( InView ) . simulate ( 'change' , { isIntersecting : true } ) ;
8282 expect ( requestCanvasAnnotations ) . toHaveBeenCalled ( ) ;
8383 } ) ;
8484 it ( 'does nothing if there is no intersection' , ( ) => {
@@ -89,7 +89,7 @@ describe('GalleryView', () => {
8989 } ;
9090 wrapper = createWrapper ( { canvas, requestCanvasAnnotations } ) ;
9191
92- wrapper . find ( IntersectionObserver ) . simulate ( 'change' , { isIntersecting : false } ) ;
92+ wrapper . find ( InView ) . simulate ( 'change' , { isIntersecting : false } ) ;
9393 expect ( requestCanvasAnnotations ) . not . toHaveBeenCalled ( ) ;
9494 } ) ;
9595 it ( 'does nothing if there are already some annotations' , ( ) => {
@@ -100,7 +100,7 @@ describe('GalleryView', () => {
100100 } ;
101101 wrapper = createWrapper ( { annotationsCount : 5 , canvas, requestCanvasAnnotations } ) ;
102102
103- wrapper . find ( IntersectionObserver ) . simulate ( 'change' , { isIntersecting : true } ) ;
103+ wrapper . find ( InView ) . simulate ( 'change' , { isIntersecting : true } ) ;
104104 expect ( requestCanvasAnnotations ) . not . toHaveBeenCalled ( ) ;
105105 } ) ;
106106 } ) ;
0 commit comments