Skip to content

Commit e46e771

Browse files
MKirovaMKirova
authored andcommitted
chore(*): Add test for new API.
1 parent 6f892c3 commit e46e771

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

projects/igniteui-angular/src/lib/grids/pivot-grid/pivot-grid.spec.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -812,6 +812,17 @@ describe('Basic IgxPivotGrid #pivotGrid', () => {
812812
expect((rowChip1.nativeElement.previousElementSibling as any).style.visibility).toBe('hidden');
813813
expect((rowChip1.nativeElement.nextElementSibling as any).style.visibility).toBe('hidden');
814814
});
815+
816+
it('should auto-size row dimension via the API.', () => {
817+
const pivotGrid = fixture.componentInstance.pivotGrid;
818+
const rowDimension = pivotGrid.pivotConfiguration.rows[0];
819+
expect(rowDimension.width).toBeUndefined();
820+
expect(pivotGrid.resolveRowDimensionWidth(rowDimension)).toBe(200);
821+
pivotGrid.autoSizeRowDimension(rowDimension);
822+
fixture.detectChanges();
823+
expect(rowDimension.width).toBe('186px');
824+
expect(pivotGrid.resolveRowDimensionWidth(rowDimension)).toBe(186);
825+
});
815826
});
816827
});
817828

0 commit comments

Comments
 (0)