@@ -424,19 +424,19 @@ describe('IgxGrid - Deferred Column Resizing #grid', () => {
424424 fixture . detectChanges ( ) ;
425425 grid = fixture . componentInstance . grid ;
426426 } ) ) ;
427+
427428 it ( 'should resize columns with % width.' , fakeAsync ( ( ) => {
428429 grid . height = null ;
429430 fixture . detectChanges ( ) ;
430431 const headers = GridFunctions . getColumnHeaders ( fixture ) ;
431-
432432 expect ( grid . columns [ 0 ] . width ) . toBe ( '25%' ) ;
433-
433+
434434 const headerResArea = headers [ 0 ] . parent . children [ 2 ] . nativeElement ;
435435 const startPos = headerResArea . getBoundingClientRect ( ) . x ;
436436 UIInteractions . simulateMouseEvent ( 'mousedown' , headerResArea , startPos , 5 ) ;
437437 tick ( 200 ) ;
438438 fixture . detectChanges ( ) ;
439-
439+
440440 const resizer = GridFunctions . getResizer ( fixture ) . nativeElement ;
441441 expect ( resizer ) . toBeDefined ( ) ;
442442 // resize with 100px, which is 25%
@@ -445,65 +445,65 @@ describe('IgxGrid - Deferred Column Resizing #grid', () => {
445445 fixture . detectChanges ( ) ;
446446 expect ( grid . columns [ 0 ] . width ) . toBe ( '50%' ) ;
447447 } ) ) ;
448-
448+
449449 it ( 'should resize columns with % width and % maxWidth.' , fakeAsync ( ( ) => {
450450 grid . height = null ;
451451 fixture . detectChanges ( ) ;
452452 const headers = GridFunctions . getColumnHeaders ( fixture ) ;
453453 grid . columns [ 0 ] . maxWidth = '30%' ;
454454 expect ( grid . columns [ 0 ] . width ) . toBe ( '25%' ) ;
455-
455+
456456 const headerResArea = headers [ 0 ] . parent . children [ 2 ] . nativeElement ;
457457 const startPos = headerResArea . getBoundingClientRect ( ) . x ;
458458 UIInteractions . simulateMouseEvent ( 'mousedown' , headerResArea , startPos , 5 ) ;
459459 tick ( 200 ) ;
460460 fixture . detectChanges ( ) ;
461-
461+
462462 const resizer = GridFunctions . getResizer ( fixture ) . nativeElement ;
463463 expect ( resizer ) . toBeDefined ( ) ;
464464 // resize with +100px, which is 25%
465465 UIInteractions . simulateMouseEvent ( 'mousemove' , resizer , startPos + 100 , 5 ) ;
466466 UIInteractions . simulateMouseEvent ( 'mouseup' , resizer , startPos + 100 , 5 ) ;
467467 fixture . detectChanges ( ) ;
468-
468+
469469 expect ( grid . columns [ 0 ] . width ) . toBe ( grid . columns [ 0 ] . maxWidth ) ;
470470 } ) ) ;
471-
471+
472472 it ( 'should resize columns with % width and % minWidth.' , fakeAsync ( ( ) => {
473473 grid . height = null ;
474474 fixture . detectChanges ( ) ;
475475 const headers = GridFunctions . getColumnHeaders ( fixture ) ;
476476 grid . columns [ 0 ] . minWidth = '10%' ;
477477 expect ( grid . columns [ 0 ] . width ) . toBe ( '25%' ) ;
478-
478+
479479 const headerResArea = headers [ 0 ] . parent . children [ 2 ] . nativeElement ;
480480 const startPos = headerResArea . getBoundingClientRect ( ) . x ;
481481 UIInteractions . simulateMouseEvent ( 'mousedown' , headerResArea , startPos , 5 ) ;
482482 tick ( 200 ) ;
483483 fixture . detectChanges ( ) ;
484-
484+
485485 const resizer = GridFunctions . getResizer ( fixture ) . nativeElement ;
486486 // resize with -100px
487487 UIInteractions . simulateMouseEvent ( 'mousemove' , resizer , startPos - 100 , 5 ) ;
488488 UIInteractions . simulateMouseEvent ( 'mouseup' , resizer , startPos - 100 , 5 ) ;
489489 fixture . detectChanges ( ) ;
490-
490+
491491 expect ( grid . columns [ 0 ] . width ) . toBe ( grid . columns [ 0 ] . minWidth ) ;
492492 } ) ) ;
493-
493+
494494 it ( 'should resize columns with % width and pixel maxWidth.' , fakeAsync ( ( ) => {
495495 grid . height = null ;
496496 fixture . detectChanges ( ) ;
497497 const headers = GridFunctions . getColumnHeaders ( fixture ) ;
498498 grid . columns [ 0 ] . maxWidth = '200px' ;
499499 expect ( grid . columns [ 0 ] . width ) . toBe ( '25%' ) ;
500-
500+
501501 const headerResArea = headers [ 0 ] . parent . children [ 2 ] . nativeElement ;
502502 const startPos = headerResArea . getBoundingClientRect ( ) . x ;
503503 UIInteractions . simulateMouseEvent ( 'mousedown' , headerResArea , startPos , 5 ) ;
504504 tick ( 200 ) ;
505505 fixture . detectChanges ( ) ;
506-
506+
507507 const resizer = GridFunctions . getResizer ( fixture ) . nativeElement ;
508508 expect ( resizer ) . toBeDefined ( ) ;
509509 // resize with +200px, which is 50%
@@ -512,50 +512,40 @@ describe('IgxGrid - Deferred Column Resizing #grid', () => {
512512 fixture . detectChanges ( ) ;
513513 expect ( grid . columns [ 0 ] . width ) . toBe ( '50%' ) ;
514514 } ) ) ;
515-
515+
516516 it ( 'should resize columns with % width and pixel minWidth.' , fakeAsync ( ( ) => {
517-
518- const fixture = TestBed . createComponent ( ColPercentageGridComponent ) ;
519- fixture . detectChanges ( ) ;
520- const grid = fixture . componentInstance . grid ;
521517 grid . height = null ;
522518 fixture . detectChanges ( ) ;
523519 const headers = GridFunctions . getColumnHeaders ( fixture ) ;
524520 // minWidth is 12.5% of the grid width - 400px
525521 grid . columns [ 0 ] . minWidth = '50px' ;
526522 expect ( grid . columns [ 0 ] . width ) . toBe ( '25%' ) ;
527-
523+
528524 const headerResArea = headers [ 0 ] . parent . children [ 2 ] . nativeElement ;
529525 const startPos = headerResArea . getBoundingClientRect ( ) . x ;
530526 UIInteractions . simulateMouseEvent ( 'mousedown' , headerResArea , startPos , 5 ) ;
531527 tick ( 200 ) ;
532528 fixture . detectChanges ( ) ;
533-
529+
534530 const resizer = GridFunctions . getResizer ( fixture ) . nativeElement ;
535531 // resize with -100px
536532 UIInteractions . simulateMouseEvent ( 'mousemove' , resizer , startPos - 100 , 5 ) ;
537533 UIInteractions . simulateMouseEvent ( 'mouseup' , resizer , startPos - 100 , 5 ) ;
538534 fixture . detectChanges ( ) ;
539-
535+
540536 expect ( grid . columns [ 0 ] . width ) . toBe ( '12.5%' ) ;
541537 } ) ) ;
542-
538+
543539 it ( 'should autosize column with % width programmatically.' , fakeAsync ( ( ) => {
544- const fixture = TestBed . createComponent ( ColPercentageGridComponent ) ;
545- fixture . detectChanges ( ) ;
546- const grid = fixture . componentInstance . grid ;
547540 grid . height = null ;
548541 fixture . detectChanges ( ) ;
549542 expect ( grid . columns [ 0 ] . width ) . toBe ( '25%' ) ;
550543 grid . columns [ 0 ] . autosize ( ) ;
551544 fixture . detectChanges ( ) ;
552545 expect ( grid . columns [ 0 ] . width ) . toBe ( '21%' ) ;
553546 } ) ) ;
554-
547+
555548 it ( 'should autosize column with % width on double click.' , fakeAsync ( ( ) => {
556- const fixture = TestBed . createComponent ( ColPercentageGridComponent ) ;
557- fixture . detectChanges ( ) ;
558- const grid = fixture . componentInstance . grid ;
559549 grid . height = null ;
560550 fixture . detectChanges ( ) ;
561551 expect ( grid . columns [ 0 ] . width ) . toBe ( '25%' ) ;
0 commit comments