diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/index.spec.js b/assets/src/scripts/monitoring-location/components/hydrograph/index.spec.js index 2bc87fc69b76d4add1740115bdc43d7ec40ffb14..f338592697bc1543566a908eb0dbd7339a37bb31 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/index.spec.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/index.spec.js @@ -96,6 +96,8 @@ const TEST_STATE = { value: '00010' }, oid: '45807190', + variableName: 'Test title for 00010', + variableDescription: 'Test description for 00010', unit: { unitCode: 'unitCode' } @@ -544,7 +546,8 @@ describe('monitoring-location/components/hydrograph module', () => { it('should have a title div', () => { const titleDiv = selectAll('.time-series-graph-title'); expect(titleDiv.size()).toBe(1); - expect(titleDiv.text()).toEqual('Test title for 00060, method description'); + expect(titleDiv.select('div').text()).toContain('Test title for 00060, method description'); + expect(titleDiv.select('.usa-tooltip').text()).toEqual('Test description for 00060'); }); it('should have a defs node', () => { @@ -591,7 +594,7 @@ describe('monitoring-location/components/hydrograph module', () => { it('should have tooltips for the select series table', () => { // one for each of the two parameters - expect(selectAll('table .usa-tooltip').size()).toBe(4); + expect(selectAll('table .usa-tooltip').size()).toBe(2); }); it('should render the data table', (done) => { diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/selectors/axes.js b/assets/src/scripts/monitoring-location/components/hydrograph/selectors/axes.js index 328cb7ba8cae64bfbfa6dc024d9c4cc9db6ea6aa..2befd4392669fca0d38e95f34e00e095b4c71115 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/selectors/axes.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/selectors/axes.js @@ -29,7 +29,8 @@ const createXAxis = function(xScale, ianaTimeZone) { * Create an x and y axis for hydrograph * @param {Object} xScale D3 Scale object for the x-axis * @param {Object} yScale D3 Scale object for the y-axis - * @param {Object} secondaryYscale - D3 Scale object for the secondary y-axis + * @param {Object} secondaryYScale - D3 Scale object for the secondary y-axis + * @param {Object} yTickDetails - Object which has information about tick values and ormat. * @param {Number} yTickSize Size of inner ticks for the y-axis * @param {String} parmCd - parameter code of time series to be shown on the graph. * @param {String} ianaTimeZone - Internet Assigned Numbers Authority designation for a time zone diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/selectors/time-series-data.js b/assets/src/scripts/monitoring-location/components/hydrograph/selectors/time-series-data.js index 94bbc1547eef8c0d25ebb93fd69ab634d9f1288a..89ab90b73b7e0dedb0b1a5a7d53f5d11957ebefd 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/selectors/time-series-data.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/selectors/time-series-data.js @@ -67,9 +67,9 @@ export const getSecondaryYLabel= createSelector( parmCd => { let secondaryYLabel = null; if (TEMPERATURE_PARAMETERS.celsius.includes(parmCd)) { - secondaryYLabel = 'degrees Fahrenheit'; + secondaryYLabel = 'deg F'; } else if(TEMPERATURE_PARAMETERS.fahrenheit.includes(parmCd)) { - secondaryYLabel = 'degrees Celsius'; + secondaryYLabel = 'deg C'; } return secondaryYLabel; } diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/selectors/time-series-data.spec.js b/assets/src/scripts/monitoring-location/components/hydrograph/selectors/time-series-data.spec.js index dd7a6d29d25a65d3dc433ddd3dac1495080e08bc..5719f63f42dfd392c83befef0d550613414c0502 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/selectors/time-series-data.spec.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/selectors/time-series-data.spec.js @@ -259,7 +259,7 @@ describe('monitoring-location/components/hydrograph/time-series module', () => { ...TEST_DATA.ivTimeSeriesState, currentIVVariableID: '45807196' } - })).toEqual('degrees Fahrenheit'); + })).toEqual('deg F'); }); it('returns a secondary label when a fahrenheit parameter is selected', () => { @@ -269,7 +269,7 @@ describe('monitoring-location/components/hydrograph/time-series module', () => { ...TEST_DATA.ivTimeSeriesState, currentIVVariableID: '45807195' } - })).toEqual('degrees Celsius'); + })).toEqual('deg C'); }); it('does not return a secondary when a parameter when a non-temperature parameter is selected', () => {