Skip to content

Commit

Permalink
remove valueGetterWith
Browse files Browse the repository at this point in the history
  • Loading branch information
brettedw committed Feb 16, 2024
1 parent fd66dcc commit 013b441
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 17 deletions.
2 changes: 0 additions & 2 deletions web/src/features/moreCast2/components/ColumnDefBuilder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,6 @@ export class ColumnDefBuilder implements ColDefGenerator, ForecastColDefGenerato

public valueFormatterWith = (params: Pick<GridValueFormatterParams, 'value'>, precision: number) =>
this.gridComponentRenderer.predictionItemValueFormatter(params, precision)
public valueGetterWith = (params: Pick<GridValueGetterParams, 'value'>, precision: number) =>
this.gridComponentRenderer.cellValueGetter(params, precision)
public valueGetter = (
params: Pick<GridValueGetterParams, 'row' | 'value'>,
field: string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,4 @@ export class GridComponentRenderer {

return isNaN(value) ? params.value : value.toFixed(precision)
}

public cellValueGetter = (params: Pick<GridValueGetterParams, 'value'>, precision: number) => {
return isNaN(params?.value) ? 'NaN' : params.value.toFixed(precision)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ describe('ColDefBuilder', () => {

it('should delegate to GridComponentRenderer', () => {
expect(colDefBuilder.valueFormatterWith({ value: 1.11 }, 1)).toEqual('1.1')
expect(colDefBuilder.valueGetterWith({ value: 1.11 }, 1)).toEqual('1.1')
expect(
colDefBuilder.valueGetter(
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,16 +182,6 @@ describe('GridComponentRenderer', () => {
expect(formattedItemValue).toEqual(NOT_REPORTING)
})

it('should return an existent cell value correctly', () => {
const cellValue = gridComponentRenderer.cellValueGetter({ value: 1.11 }, 1)
expect(cellValue).toEqual('1.1')
})

it('should return an non-existent cell value correctly', () => {
const cellValue = gridComponentRenderer.cellValueGetter({ value: NaN }, 1)
expect(cellValue).toEqual('NaN')
})

it('should return an existent prediction item value correctly', () => {
const itemValue = gridComponentRenderer.valueGetter(
{
Expand Down

0 comments on commit 013b441

Please sign in to comment.