From e60edd4b88768e9eabfcc0f30cd27b2c0be64127 Mon Sep 17 00:00:00 2001 From: Aaron Briggs <abriggs@contractor.usgs.gov> Date: Fri, 1 Jul 2022 13:55:00 -0500 Subject: [PATCH] fixed existing tests --- .../components/hydrograph/method-picker.test.js | 12 ++++++------ .../hydrograph/selectors/time-series-data.test.js | 4 ++-- .../hydrograph/vue-components/data-table.test.js | 3 ++- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/method-picker.test.js b/assets/src/scripts/monitoring-location/components/hydrograph/method-picker.test.js index 5dfb46d2c..c40241b4b 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/method-picker.test.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/method-picker.test.js @@ -30,7 +30,7 @@ describe('monitoring-location/components/hydrograph/method-picker', () => { it('Creates a picker and sets the currentMethodID to preferred method id', () => { let store = configureStore(TEST_STATE); - div.call(drawMethodPicker, getSortedIVMethods(store.getState()), store); + div.call(drawMethodPicker, getSortedIVMethods('primary')(store.getState()), store); expect(div.select('select').property('value')).toEqual('90649'); }); @@ -49,7 +49,7 @@ describe('monitoring-location/components/hydrograph/method-picker', () => { } } }); - div.call(drawMethodPicker, getSortedIVMethods(store.getState()), store); + div.call(drawMethodPicker, getSortedIVMethods('primary')(store.getState()), store); expect(div.select('#primary-sampling-method-row').size()).toBe(0); }); @@ -58,7 +58,7 @@ describe('monitoring-location/components/hydrograph/method-picker', () => { let store = configureStore({ ...TEST_STATE }); - div.call(drawMethodPicker, getSortedIVMethods(store.getState()), store); + div.call(drawMethodPicker, getSortedIVMethods('primary')(store.getState()), store); const allOptionElements = div.selectAll('option'); expect(allOptionElements['_groups'][0][0].getAttribute('value')).toBe('90649'); expect(allOptionElements['_groups'][0][1].getAttribute('value')).toBe('252055'); @@ -68,7 +68,7 @@ describe('monitoring-location/components/hydrograph/method-picker', () => { let store = configureStore({ ...TEST_STATE }); - div.call(drawMethodPicker, getSortedIVMethods(store.getState()), store); + div.call(drawMethodPicker, getSortedIVMethods('primary')(store.getState()), store); expect(div.select('#no-data-points-note')['_groups'][0][0].innerHTML).toContain('some methods/sub-locations are disabled'); }); @@ -77,7 +77,7 @@ describe('monitoring-location/components/hydrograph/method-picker', () => { let store = configureStore({ ...TEST_STATE }); - div.call(drawMethodPicker, getSortedIVMethods(store.getState()), store); + div.call(drawMethodPicker, getSortedIVMethods('primary')(store.getState()), store); expect(div.select('.usa-tooltip__body')['_groups'][0][0].innerHTML).toContain('The names used in ' + 'dropdown menu are often specific to a particular monitoring location and describe sampling ' + @@ -110,7 +110,7 @@ describe('monitoring-location/components/hydrograph/method-picker', () => { } } }); - div.call(drawMethodPicker, getSortedIVMethods(store.getState()), store); + div.call(drawMethodPicker, getSortedIVMethods('primary')(store.getState()), store); expect(div.select('#no-data-points-note').size()).toBe(0); }); diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/selectors/time-series-data.test.js b/assets/src/scripts/monitoring-location/components/hydrograph/selectors/time-series-data.test.js index 787667bf4..446668419 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/selectors/time-series-data.test.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/selectors/time-series-data.test.js @@ -544,7 +544,7 @@ describe('monitoring-location/components/hydrograph/selectors/time-series-data m describe('getSortedIVMethods', () => { it('The first object in the array will have the most data points', () => { - const result = getSortedIVMethods({ + const result = getSortedIVMethods('primary')({ hydrographData: { ...TEST_STATE.hydrographData, primaryIVData: { @@ -576,7 +576,7 @@ describe('monitoring-location/components/hydrograph/selectors/time-series-data m expect(result.methods[2].methodID).toBe('69937'); }); it('If there is not a sampling method description, the method id will be used', () => { - const result = getSortedIVMethods({ + const result = getSortedIVMethods('primary')({ hydrographData: { ...TEST_STATE.hydrographData, primaryIVData: { diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/vue-components/data-table.test.js b/assets/src/scripts/monitoring-location/components/hydrograph/vue-components/data-table.test.js index e092e4d5b..a9b017463 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/vue-components/data-table.test.js +++ b/assets/src/scripts/monitoring-location/components/hydrograph/vue-components/data-table.test.js @@ -147,7 +147,8 @@ describe('monitoring-location/components/hydrograph/components/data-table.vue', hydrographState: { showSecondaryIVData: true, selectedParameterCode: '72019', - selectedIVMethodID: '90649' + selectedIVMethodID: '90649', + selectedSecondaryIVMethodID: '57465' } }); -- GitLab