Skip to content

Commit 8fc80e3

Browse files
MKirovaMKirova
authored andcommitted
chore(*): Attempt to fix issue with expected value rounding.
1 parent 67a123a commit 8fc80e3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ describe('IgxGrid - multi-column headers #grid', () => {
306306
const scrWitdh = grid.nativeElement.querySelector('.igx-grid__tbody-scrollbar').getBoundingClientRect().width;
307307
const availableWidth = (parseInt(componentInstance.gridWrapperWidthPx, 10) - scrWitdh).toString();
308308
const locationColGroup = getColGroup(grid, 'Location');
309-
const colWidth = Math.round(parseInt(availableWidth, 10) / 3);
309+
const colWidth = Math.floor(parseInt(availableWidth, 10) / 3);
310310
const colWidthPx = colWidth + 'px';
311311
expect(locationColGroup.width).toBe((Math.round(colWidth) * 3) + 'px');
312312
const countryColumn = grid.getColumnByName('Country');
@@ -329,7 +329,7 @@ describe('IgxGrid - multi-column headers #grid', () => {
329329
fixture.detectChanges();
330330
const scrWitdh = grid.nativeElement.querySelector('.igx-grid__tbody-scrollbar').getBoundingClientRect().width;
331331
const gridWidthInPx = parseInt(gridWidth, 10) - scrWitdh;
332-
const colWidth = Math.round(gridWidthInPx / 3);
332+
const colWidth = Math.floor(gridWidthInPx / 3);
333333
const colWidthPx = colWidth + 'px';
334334
const locationColGroup = getColGroup(grid, 'Location');
335335
expect(locationColGroup.width).toBe((Math.round(colWidth) * 3) + 'px');
@@ -356,7 +356,7 @@ describe('IgxGrid - multi-column headers #grid', () => {
356356

357357
const gridWidthInPx = (parseInt(gridWidth, 10) / 100) *
358358
parseInt(componentInstance.gridWrapperWidthPx, 10) - scrWitdh;
359-
const colWidth = Math.round(gridWidthInPx / 3);
359+
const colWidth = Math.floor(gridWidthInPx / 3);
360360
const colWidthPx = colWidth + 'px';
361361
const locationColGroup = getColGroup(grid, 'Location');
362362
expect(locationColGroup.width).toBe((Math.round(colWidth) * 3) + 'px');

0 commit comments

Comments
 (0)