@@ -794,60 +794,38 @@ describe('Basic IgxHierarchicalGrid #hGrid', () => {
794794
795795 const row = childGrid . gridAPI . get_row_by_index ( 0 ) ;
796796 spyOnProperty ( childGrid . crudService , 'rowInEditMode' , 'get' ) . and . returnValue ( row ) ;
797- spyOnProperty ( childGrid . rowEditingOverlay , 'collapsed' , 'get' ) . and . returnValue ( false ) ;
798- childGrid . rowEditingOverlay . element . style . display = 'block' ;
797+ childGrid . openRowOverlay ( row . key ) ;
798+ fixture . detectChanges ( ) ;
799+
800+ expect ( childGrid . rowEditingOverlay . collapsed ) . toBeFalse ( ) ;
801+
802+ const parentTbody = hierarchicalGrid . tbody . nativeElement . parentElement ;
803+ const childTbody = childGrid . tbody . nativeElement . parentElement ;
804+ const overlayContent = childGrid . rowEditingOverlay . element . parentElement ;
799805
800- spyOn ( ( hierarchicalGrid as any ) . tbodyContainer . nativeElement , 'getBoundingClientRect' ) . and . returnValue ( {
801- top : 0 ,
802- bottom : 200
806+ parentTbody . style . overflow = 'hidden' ;
807+ childTbody . style . overflow = 'hidden' ;
808+ spyOn ( parentTbody , 'getBoundingClientRect' ) . and . returnValue ( {
809+ top : 0 , right : 500 , bottom : 200 , left : 0
810+ } as DOMRect ) ;
811+ spyOn ( childTbody , 'getBoundingClientRect' ) . and . returnValue ( {
812+ top : 0 , right : 500 , bottom : 200 , left : 0
813+ } as DOMRect ) ;
814+ spyOn ( childGrid . tbody . nativeElement , 'getBoundingClientRect' ) . and . returnValue ( {
815+ top : - 100 , right : 500 , bottom : 500 , left : 0
803816 } as DOMRect ) ;
804- let childRowRect = {
805- top : 40 ,
806- bottom : 80
807- } as DOMRect ;
808- spyOn ( row . nativeElement , 'getBoundingClientRect' ) . and . callFake ( ( ) => childRowRect ) ;
809- const repositionOverlaySpy = spyOn ( childGrid , 'repositionRowEditingOverlay' ) ;
810- const toggleOverlaySpy = spyOn ( childGrid , 'toggleRowEditingOverlay' ) . and . callThrough ( ) ;
811-
812- const scroll = hierarchicalGrid . verticalScrollContainer . getScroll ( ) ;
813- scroll . scrollTop = 10 ;
814- ( hierarchicalGrid as any ) . verticalScrollHandler ( { target : scroll } ) ;
815- ( hierarchicalGrid as any ) . zone . onStable . emit ( null ) ;
816- fixture . detectChanges ( ) ;
817-
818- expect ( repositionOverlaySpy ) . toHaveBeenCalledWith ( row ) ;
819- expect ( toggleOverlaySpy ) . not . toHaveBeenCalledWith ( false ) ;
820- expect ( childGrid . rowEditingOverlay . element . style . display ) . not . toBe ( 'none' ) ;
821-
822- repositionOverlaySpy . calls . reset ( ) ;
823- toggleOverlaySpy . calls . reset ( ) ;
824- childRowRect = {
825- top : - 80 ,
826- bottom : - 40
827- } as DOMRect ;
828- scroll . scrollTop = 1000 ;
829- ( hierarchicalGrid as any ) . verticalScrollHandler ( { target : scroll } ) ;
830- ( hierarchicalGrid as any ) . zone . onStable . emit ( null ) ;
831- fixture . detectChanges ( ) ;
832-
833- expect ( repositionOverlaySpy ) . not . toHaveBeenCalled ( ) ;
834- expect ( toggleOverlaySpy ) . toHaveBeenCalledWith ( false ) ;
835- expect ( childGrid . rowEditingOverlay . element . style . display ) . toBe ( 'none' ) ;
836-
837- repositionOverlaySpy . calls . reset ( ) ;
838- toggleOverlaySpy . calls . reset ( ) ;
839- childRowRect = {
840- top : 40 ,
841- bottom : 80
842- } as DOMRect ;
843- scroll . scrollTop = 10 ;
844- ( hierarchicalGrid as any ) . verticalScrollHandler ( { target : scroll } ) ;
845- ( hierarchicalGrid as any ) . zone . onStable . emit ( null ) ;
846- fixture . detectChanges ( ) ;
847-
848- expect ( toggleOverlaySpy ) . toHaveBeenCalledWith ( true ) ;
849- expect ( repositionOverlaySpy ) . toHaveBeenCalledWith ( row ) ;
850- expect ( childGrid . rowEditingOverlay . element . style . display ) . not . toBe ( 'none' ) ;
817+ spyOn ( row . nativeElement , 'getBoundingClientRect' ) . and . returnValue ( {
818+ top : - 120 , right : 500 , bottom : - 80 , left : 0
819+ } as DOMRect ) ;
820+ spyOn ( overlayContent , 'getBoundingClientRect' ) . and . returnValue ( {
821+ top : - 80 , right : 500 , bottom : - 32 , left : 0 , width : 500 , height : 48
822+ } as DOMRect ) ;
823+
824+ childGrid . rowEditingOverlay . reposition ( ) ;
825+ fixture . detectChanges ( ) ;
826+
827+ expect ( overlayContent . style . clipPath ) . toBe ( 'inset(100%)' ) ;
828+ expect ( overlayContent . style . pointerEvents ) . toBe ( 'none' ) ;
851829 } ) ;
852830
853831 it ( 'Should apply runtime option changes to all related child grids (both existing and not yet initialized).' , ( ) => {
0 commit comments