@@ -16,6 +16,7 @@ import { IgxAvatarComponent } from '../../avatar/avatar.component';
1616import { IColumnResizeEventArgs , IgxColumnComponent } from '../public_api' ;
1717import { Size } from "../common/enums" ;
1818import { setElementSize } from '../../test-utils/helper-utils.spec' ;
19+ import { IgxColumnResizerDirective } from '../resizing/resizer.directive' ;
1920
2021describe ( 'IgxGrid - Deferred Column Resizing #grid' , ( ) => {
2122
@@ -133,6 +134,27 @@ describe('IgxGrid - Deferred Column Resizing #grid', () => {
133134 expect ( grid . columnList . get ( 1 ) . width ) . toEqual ( '70px' ) ;
134135 } ) ) ;
135136
137+ it ( 'should calculate correct resizer position and column width when grid is scaled and zoomed' , fakeAsync ( ( ) => {
138+ grid . nativeElement . style . transform = 'scale(1.2)' ;
139+ grid . nativeElement . style . setProperty ( 'zoom' , '1.05' ) ;
140+ fixture . detectChanges ( ) ;
141+ headerResArea = GridFunctions . getHeaderResizeArea ( headers [ 1 ] ) . nativeElement ;
142+ UIInteractions . simulateMouseEvent ( 'mousedown' , headerResArea , 153 , 0 ) ;
143+ tick ( 200 ) ;
144+ fixture . detectChanges ( ) ;
145+
146+ const resizer = GridFunctions . getResizer ( fixture ) ;
147+ const resizerDirective = resizer . componentInstance . resizer as IgxColumnResizerDirective ;
148+ const leftSetterSpy = spyOnProperty ( resizerDirective , 'left' , 'set' ) . and . callThrough ( ) ;
149+ UIInteractions . simulateMouseEvent ( 'mousemove' , resizer . nativeElement , 200 , 5 ) ;
150+ UIInteractions . simulateMouseEvent ( 'mouseup' , resizer . nativeElement , 200 , 5 ) ;
151+ fixture . detectChanges ( ) ;
152+
153+ expect ( leftSetterSpy ) . toHaveBeenCalled ( ) ;
154+ expect ( parseInt ( leftSetterSpy . calls . mostRecent ( ) . args [ 0 ] . toFixed ( 0 ) ) ) . toEqual ( 200 ) ;
155+ expect ( parseInt ( grid . columnList . get ( 1 ) . headerCell . nativeElement . getBoundingClientRect ( ) . width . toFixed ( 0 ) ) ) . toEqual ( 173 ) ;
156+ } ) ) ;
157+
136158 it ( 'should be able to resize column to the minWidth < defaultMinWidth' , fakeAsync ( ( ) => {
137159 const column = grid . getColumnByName ( 'ID' ) ;
138160 column . minWidth = 'a' ;
0 commit comments