Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
romgrk committed Feb 28, 2024
1 parent 5ed191a commit 0aa8cee
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions packages/x-data-grid-pro/src/tests/rows.DataGridPro.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -453,10 +453,8 @@ describe('<DataGridPro /> - Rows', () => {

const lastCell = $$('[role="row"]:last-child [role="gridcell"]')[0];
expect(lastCell).to.have.text('995');
expect(content.length).to.equal(Math.floor((height - 1) / rowHeight) + rowBuffer); // Subtracting 1 is needed because of the column header borders
expect(content.length).to.equal(Math.floor(height / rowHeight) + rowBuffer); // Subtracting 1 is needed because of the column header borders
const scrollbarSize = apiRef.current.state.dimensions.scrollbarSize;
const distanceToFirstRow = (nbRows - content.length) * rowHeight;
expect(gridOffsetTop()).to.equal(distanceToFirstRow);
expect(virtualScroller.scrollHeight - scrollbarSize).to.equal(nbRows * rowHeight);
});

Expand Down
2 changes: 1 addition & 1 deletion test/utils/helperFn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function gridVar(name: string) {
}

export function gridOffsetTop() {
const transform = getComputedStyle(grid('virtualScrollerRenderZone')!).transform;
const transform = getComputedStyle(grid('virtualScrollerContent')!).transform;
return parseInt(
transform.startsWith('translate3d')
? transform.split('(')[1].split(',')[1]
Expand Down

0 comments on commit 0aa8cee

Please sign in to comment.