From 538d8a5dbd5b3a177acac3d20a4a735802d4bc5c Mon Sep 17 00:00:00 2001 From: Brett Edwards Date: Tue, 13 Feb 2024 12:16:08 -0800 Subject: [PATCH] test changes --- .../components/colDefBuilder.test.tsx | 28 ++++++++++++++++--- .../components/gridComponentRenderer.test.tsx | 15 ---------- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/web/src/features/moreCast2/components/colDefBuilder.test.tsx b/web/src/features/moreCast2/components/colDefBuilder.test.tsx index 192cd1c2b..d554f2224 100644 --- a/web/src/features/moreCast2/components/colDefBuilder.test.tsx +++ b/web/src/features/moreCast2/components/colDefBuilder.test.tsx @@ -39,7 +39,7 @@ describe('ColDefBuilder', () => { }) ) }) - it('should generate all col defs correcty', () => { + it('should generate all col defs correctly', () => { const colDefs = colDefBuilder.generateColDefs() const expected = [ @@ -62,7 +62,7 @@ describe('ColDefBuilder', () => { headerName: determinate, sortable: false, type: 'number', - width: DEFAULT_COLUMN_WIDTH + width: determinate === WeatherDeterminate.ACTUAL ? DEFAULT_FORECAST_COLUMN_WIDTH : DEFAULT_COLUMN_WIDTH }) ) ) @@ -146,14 +146,34 @@ describe('ColDefBuilder', () => { ) expect( forecastColDef.renderCell({ row: { testField: { choice: ModelChoice.GDPS, value: 1 } }, formattedValue: 1 }) - ).toEqual() + ).toEqual( + + ) expect( forecastColDef.renderCell({ row: { testField: { choice: ModelChoice.GDPS, value: 1 }, testActual: 2 }, formattedValue: 1 }) - ).toEqual() + ).toEqual( + + ) expect(forecastColDef.valueFormatter({ value: 1.11 })).toEqual('1.1') expect( forecastColDef.valueGetter({ diff --git a/web/src/features/moreCast2/components/gridComponentRenderer.test.tsx b/web/src/features/moreCast2/components/gridComponentRenderer.test.tsx index 1a100d9b9..3397ad214 100644 --- a/web/src/features/moreCast2/components/gridComponentRenderer.test.tsx +++ b/web/src/features/moreCast2/components/gridComponentRenderer.test.tsx @@ -112,19 +112,4 @@ describe('GridComponentRenderer', () => { const actualField = gridComponentRenderer.getActualField('testForecast') expect(actualField).toEqual('testActual') }) - - it('should return an actual over a prediction if it exists', () => { - const itemValue = gridComponentRenderer.valueGetter( - { - row: { - testForecast: { choice: ModelChoice.GDPS, value: 1.11 }, - testActual: 2.22 - }, - value: { choice: ModelChoice.GDPS, value: 1.11 } - }, - 1, - 'testForecast' - ) - expect(itemValue).toEqual('2.2') - }) })