Skip to content
Snippets Groups Projects
Commit c6a4a182 authored by Williams, Darius Shamar's avatar Williams, Darius Shamar
Browse files

tests

parent ebc506e3
No related branches found
No related tags found
1 merge request!345Wdfn 745 - Replace components/hydrograph/time-span-shortcuts.js with a Vue component
...@@ -81,7 +81,7 @@ describe('monitoring-location/components/hydrograph/components/graph-controls', ...@@ -81,7 +81,7 @@ describe('monitoring-location/components/hydrograph/components/graph-controls',
showCompareIVData: false, showCompareIVData: false,
selectedTimeSpan: 'P7D', selectedTimeSpan: 'P7D',
showMedianData: false, showMedianData: false,
selectedParameterCode: '72019' selectedParameterCode: '00060'
} }
}); });
...@@ -96,7 +96,7 @@ describe('monitoring-location/components/hydrograph/components/graph-controls', ...@@ -96,7 +96,7 @@ describe('monitoring-location/components/hydrograph/components/graph-controls',
], ],
provide: { provide: {
store: store, store: store,
siteno: '12345678', siteno: '11112222',
agencyCd: 'USGS' agencyCd: 'USGS'
} }
} }
...@@ -112,13 +112,13 @@ describe('monitoring-location/components/hydrograph/components/graph-controls', ...@@ -112,13 +112,13 @@ describe('monitoring-location/components/hydrograph/components/graph-controls',
expect(wrapper.findAll('.gw-button-container')).toHaveLength(0); expect(wrapper.findAll('.gw-button-container')).toHaveLength(0);
expect(radio7Day.attributes('type')).toBe('radio'); expect(radio7Day.attributes('type')).toBe('radio');
expect(radio7Day.attributes('checked')).toBe(true); expect(radio7Day.element.checked).toBe(true);
expect(radio30Day.attributes('type')).toBe('radio'); expect(radio30Day.attributes('type')).toBe('radio');
expect(radio30Day.attributes('checked')).toBe(false); expect(radio30Day.element.checked).toBe(false);
expect(radio1Year.attributes('type')).toBe('radio'); expect(radio1Year.attributes('type')).toBe('radio');
expect(radio1Year.attributes('checked')).toBe(false); expect(radio1Year.element.checked).toBe(false);
}); });
it('Expects that if the selectedTimeSpan is changed to a days before that is not a shortcut, they are all unset', async() => { it('Expects that if the selectedTimeSpan is changed to a days before that is not a shortcut, they are all unset', async() => {
...@@ -129,9 +129,9 @@ describe('monitoring-location/components/hydrograph/components/graph-controls', ...@@ -129,9 +129,9 @@ describe('monitoring-location/components/hydrograph/components/graph-controls',
const radio30Day = wrapper.find('#P30D-input'); const radio30Day = wrapper.find('#P30D-input');
const radio1Year = wrapper.find('#P365D-input'); const radio1Year = wrapper.find('#P365D-input');
expect(radio7Day.attributes('checked')).toBe(false); expect(radio7Day.element.checked).toBe(false);
expect(radio30Day.attributes('checked')).toBe(false); expect(radio30Day.element.checked).toBe(false);
expect(radio1Year.attributes('checked')).toBe(false); expect(radio1Year.element.checked).toBe(false);
}); });
it('Expects that if the selectedTimeSpan is changed to a date range, the shortcut radio buttons are not checked', async() => { it('Expects that if the selectedTimeSpan is changed to a date range, the shortcut radio buttons are not checked', async() => {
...@@ -142,9 +142,9 @@ describe('monitoring-location/components/hydrograph/components/graph-controls', ...@@ -142,9 +142,9 @@ describe('monitoring-location/components/hydrograph/components/graph-controls',
const radio30Day = wrapper.find('#P30D-input'); const radio30Day = wrapper.find('#P30D-input');
const radio1Year = wrapper.find('#P365D-input'); const radio1Year = wrapper.find('#P365D-input');
expect(radio7Day.attributes('checked')).toBe(false); expect(radio7Day.element.checked).toBe(false);
expect(radio30Day.attributes('checked')).toBe(false); expect(radio30Day.element.checked).toBe(false);
expect(radio1Year.attributes('checked')).toBe(false); expect(radio1Year.element.checked).toBe(false);
}); });
it('Expects that clicking a radio button updates the selectedTimeSpan and retrieve the data', () => { it('Expects that clicking a radio button updates the selectedTimeSpan and retrieve the data', () => {
......
...@@ -103,14 +103,14 @@ export default { ...@@ -103,14 +103,14 @@ export default {
const agencyCd = inject('agencyCd'); const agencyCd = inject('agencyCd');
function setTimeSpan(timeSpan) { function setTimeSpan(timeSpan) {
actions.setSelectedTimeSpan(timeSpan); actions.setSelectedTimeSpan(timeSpan);
actions.clearGraphBrushOffset(); actions.clearGraphBrushOffset();
showDataIndicators(true, reduxStore); showDataIndicators(true, reduxStore);
const reduxState = reduxStore.getState(); const reduxState = reduxStore.getState();
actions.retrieveHydrographData(siteno, agencyCd, getInputsForRetrieval(reduxState)) actions.retrieveHydrographData(siteno, agencyCd, getInputsForRetrieval(reduxState))
.then(() => { .then(() => {
showDataIndicators(false, reduxStore); showDataIndicators(false, reduxStore);
}); });
}; };
return { return {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment