@@ -39,15 +39,13 @@ describe('AnnotationThread', () => {
3939 messages : { } ,
4040 } ,
4141 fileVersionId : '1' ,
42- isMobile : false ,
4342 location : { } ,
4443 threadID : '2' ,
4544 threadNumber : '1' ,
4645 type : 'point' ,
4746 } ) ;
4847
4948 thread . emit = jest . fn ( ) ;
50- util . shouldDisplayMobileUI = jest . fn ( ) . mockReturnValue ( false ) ;
5149 } ) ;
5250
5351 afterEach ( ( ) => {
@@ -91,18 +89,6 @@ describe('AnnotationThread', () => {
9189 thread . location = { } ;
9290 expect ( thread . getPopoverParent ( ) ) . toEqual ( 'annotatedElement' ) ;
9391 } ) ;
94-
95- it ( 'should return container if user should see the mobile UI' , ( ) => {
96- thread . location = { page : 1 } ;
97- util . shouldDisplayMobileUI = jest . fn ( ) . mockReturnValue ( true ) ;
98- expect ( thread . getPopoverParent ( ) ) . toEqual ( 'container' ) ;
99- } ) ;
100-
101- it ( 'should return the page element if user should NOT see the mobile UI' , ( ) => {
102- thread . location = { page : 1 } ;
103- util . shouldDisplayMobileUI = jest . fn ( ) . mockReturnValue ( false ) ;
104- expect ( thread . getPopoverParent ( ) ) . toEqual ( 'pageEl' ) ;
105- } ) ;
10692 } ) ;
10793
10894 describe ( 'unmountPopover' , ( ) => {
@@ -142,7 +128,6 @@ describe('AnnotationThread', () => {
142128 it ( 'should render and display the popover for this annotation' , ( ) => {
143129 thread . getPopoverParent = jest . fn ( ) . mockReturnValue ( rootElement ) ;
144130 util . getPopoverLayer = jest . fn ( ) . mockReturnValue ( rootElement ) ;
145- util . shouldDisplayMobileUI = jest . fn ( ) . mockReturnValue ( false ) ;
146131 ReactDOM . render = jest . fn ( ) ;
147132 thread . position = jest . fn ( ) ;
148133
@@ -293,18 +278,11 @@ describe('AnnotationThread', () => {
293278 expect ( thread . emit ) . toBeCalledWith ( THREAD_EVENT . save ) ;
294279 } ) ;
295280
296- it ( 'should only render popover on desktop ' , ( ) => {
281+ it ( 'should only render popover' , ( ) => {
297282 thread . updateTemporaryAnnotation ( tempAnnotation . id , serverAnnotation ) ;
298283 expect ( thread . renderAnnotationPopover ) . toBeCalled ( ) ;
299284 expect ( thread . state ) . toEqual ( STATES . inactive ) ;
300285 } ) ;
301-
302- it ( 'should only render popover on mobile' , ( ) => {
303- util . shouldDisplayMobileUI = jest . fn ( ) . mockReturnValue ( true ) ;
304- thread . updateTemporaryAnnotation ( tempAnnotation . id , serverAnnotation ) ;
305- expect ( thread . state ) . toEqual ( STATES . active ) ;
306- expect ( thread . renderAnnotationPopover ) . toBeCalled ( ) ;
307- } ) ;
308286 } ) ;
309287
310288 describe ( 'delete()' , ( ) => {
@@ -601,12 +579,6 @@ describe('AnnotationThread', () => {
601579 thread . bindDOMListeners ( ) ;
602580 expect ( thread . element . addEventListener ) . toBeCalledWith ( 'click' , expect . any ( Function ) ) ;
603581 } ) ;
604-
605- it ( 'should not add mouseleave listener for mobile browsers' , ( ) => {
606- util . shouldDisplayMobileUI = jest . fn ( ) . mockReturnValue ( true ) ;
607- thread . bindDOMListeners ( ) ;
608- expect ( thread . element . addEventListener ) . toBeCalledWith ( 'click' , expect . any ( Function ) ) ;
609- } ) ;
610582 } ) ;
611583
612584 describe ( 'unbindDOMListeners()' , ( ) => {
@@ -619,12 +591,6 @@ describe('AnnotationThread', () => {
619591 thread . unbindDOMListeners ( ) ;
620592 expect ( thread . element . removeEventListener ) . toBeCalledWith ( 'click' , expect . any ( Function ) ) ;
621593 } ) ;
622-
623- it ( 'should not add mouseleave listener for mobile browsers' , ( ) => {
624- util . shouldDisplayMobileUI = jest . fn ( ) . mockReturnValue ( true ) ;
625- thread . unbindDOMListeners ( ) ;
626- expect ( thread . element . removeEventListener ) . toBeCalledWith ( 'click' , expect . any ( Function ) ) ;
627- } ) ;
628594 } ) ;
629595
630596 describe ( 'cancelUnsavedAnnotation()' , ( ) => {
0 commit comments