Skip to content

Commit

Permalink
[cleanup] Remove now-unused compareHeights util
Browse files Browse the repository at this point in the history
+ clean up mock rowHeightUtils as well
  • Loading branch information
cee-chen committed Oct 25, 2021
1 parent 22aed7a commit 1e3ded2
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 13 deletions.
5 changes: 0 additions & 5 deletions src/components/datagrid/__mocks__/row_height_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,7 @@ export const mockRowHeightUtils = ({
isAutoHeight: jest.fn(() => false),
setRowHeight: jest.fn(),
getRowHeight: jest.fn(() => 32),
getFont: jest.fn(() => null),
getComputedCellStyles: jest.fn(() => {}),
compareHeights: jest.fn(
(currentRowHeight: number, cachedRowHeight: number) =>
currentRowHeight === cachedRowHeight
),
getCalculatedHeight: jest.fn(
(heightOption: EuiDataGridRowHeightOption, defaultHeight: number) => {
if (typeof heightOption === 'object') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ exports[`EuiDataGridCell renders 1`] = `
rowHeightUtils={
Object {
"clearHeightsCache": [MockFunction],
"compareHeights": [MockFunction],
"computeStylesForGridCell": [MockFunction],
"getCalculatedHeight": [MockFunction],
"getComputedCellStyles": [MockFunction],
"getFont": [MockFunction],
"getRowHeight": [MockFunction],
"getStylesForCell": [MockFunction],
"isAutoHeight": [MockFunction],
Expand Down Expand Up @@ -60,11 +58,9 @@ exports[`EuiDataGridCell renders 1`] = `
rowHeightUtils={
Object {
"clearHeightsCache": [MockFunction],
"compareHeights": [MockFunction],
"computeStylesForGridCell": [MockFunction],
"getCalculatedHeight": [MockFunction],
"getComputedCellStyles": [MockFunction],
"getFont": [MockFunction],
"getRowHeight": [MockFunction],
"getStylesForCell": [MockFunction],
"isAutoHeight": [MockFunction],
Expand Down
4 changes: 0 additions & 4 deletions src/components/datagrid/row_height_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,6 @@ export class RowHeightUtils {
return 0;
}

compareHeights(currentRowHeight: number, cachedRowHeight: number) {
return currentRowHeight === cachedRowHeight;
}

resetGrid() {
this.grid?.resetAfterRowIndex(this.lastUpdatedRow);
this.lastUpdatedRow = Infinity;
Expand Down

0 comments on commit 1e3ded2

Please sign in to comment.