diff --git a/assets/src/scripts/monitoring-location/store/hydrograph-data.js b/assets/src/scripts/monitoring-location/store/hydrograph-data.js index 216721a1dd8c238fa0fcb07fe99f40e7ab2faed3..4f412a42e2f7005fc716dd3f559fbaad24cdf50a 100644 --- a/assets/src/scripts/monitoring-location/store/hydrograph-data.js +++ b/assets/src/scripts/monitoring-location/store/hydrograph-data.js @@ -124,7 +124,7 @@ const retrieveIVData = function(siteno, dataKind, {parameterCode, period, startT points: value.value.map(point => { let pointValue = parseFloat(point.value); pointValue = pointValue === noDataValue ? null : pointValue; - if (pointValue && isCalculatedTemperatureCode) { + if (pointValue !== null && isCalculatedTemperatureCode) { pointValue = parseFloat(convertCelsiusToFahrenheit(pointValue).toFixed(2)); } return { diff --git a/assets/src/scripts/monitoring-location/store/hydrograph-data.test.js b/assets/src/scripts/monitoring-location/store/hydrograph-data.test.js index 8f01ffef070ecd7c8b2e13e75abc69d1d5cd440e..ba3944dbef3a85ee741e92b62ad7322f4aad22cd 100644 --- a/assets/src/scripts/monitoring-location/store/hydrograph-data.test.js +++ b/assets/src/scripts/monitoring-location/store/hydrograph-data.test.js @@ -390,8 +390,10 @@ describe('monitoring-location/store/hydrograph-data', () => { description: 'Temperature, water, degrees Fahrenheit (calculated)', unit: 'deg F' }); + const values = hydrographData.primaryIVData.values['157775'].points.map(point => point.value); + expect(values).toHaveLength(3); + expect(values).toEqual([35.60, 32.00, 35.78]); }); - }); }); });