Skip to content
Snippets Groups Projects
Commit 4387cead authored by Briggs, Aaron Shane's avatar Briggs, Aaron Shane
Browse files

change table ids

parent 4a36a90a
No related branches found
No related tags found
1 merge request!365WDFN-735 Plot Secondary Parameter - fetch data and add data table
......@@ -364,7 +364,7 @@ describe('monitoring-location/components/hydrograph module', () => {
});
it('should have data tables for hydrograph data', () => {
expect(select('#iv-table-container').size()).toBe(1);
expect(select('#iv-primary-table-container').size()).toBe(1);
expect(select('#gw-table-container').size()).toBe(1);
});
......@@ -477,7 +477,7 @@ describe('monitoring-location/components/hydrograph module', () => {
});
it('should not have data tables for hydrograph data', () => {
expect(select('#iv-table-container').size()).toBe(0);
expect(select('#iv-primary-table-container').size()).toBe(0);
expect(select('#gw-table-container').size()).toBe(0);
});
......
......@@ -43,6 +43,34 @@ export const TEST_PRIMARY_IV_DATA = {
}
};
export const TEST_SECONDARY_IV_DATA = {
parameter: {
parameterCode: '00065',
name: 'Gage height, ft',
description: 'Gage height, feet',
unit: 'ft'
},
values: {
'57465': {
points: [
{value: '3', qualifiers: ['A'], dateTime: 1582560900000},
{value: '3.2', qualifiers: ['A'], dateTime: 1582561800000},
{value: null, qualifiers: ['A', 'ICE'], dateTime: 1582562700000},
{value: null, qualifiers: ['A', 'ICE'], dateTime: 1582569900000},
{value: '4', qualifiers: ['E'], dateTime: 1582570800000},
{value: '5.8', qualifiers: ['E'], dateTime: 1600617600000},
{value: '7', qualifiers: ['E'], dateTime: 1600618500000},
{value: '6.5', qualifiers: ['P'], dateTime: 1600619400000},
{value: '5.9', qualifiers: ['P'], dateTime: 1600620300000}
],
method: {
methodID: '57465',
methodDescription: ''
}
}
}
};
export const TEST_STATS_DATA = {
'153885': [
{month_nu: 2, day_nu: 24, p50_va: 16, ts_id: '153885', loc_web_ds: 'Method1', begin_yr: '2011', end_yr: '2020', max_va_yr: '2020',
......
......@@ -7,7 +7,7 @@ import config from 'ui/config';
import {configureStore} from 'ml/store';
import {TEST_PRIMARY_IV_DATA, TEST_GW_LEVELS} from '../mock-hydrograph-state';
import {TEST_PRIMARY_IV_DATA, TEST_GW_LEVELS, TEST_SECONDARY_IV_DATA} from '../mock-hydrograph-state';
import DataTable from './data-table.vue';
import DownloadData from './download-data.vue';
......@@ -51,7 +51,7 @@ describe('monitoring-location/components/hydrograph/components/data-table.vue',
}
});
expect(wrapper.find('#iv-table-container').isVisible()).toBe(true);
expect(wrapper.find('#iv-primary-table-container').isVisible()).toBe(true);
expect(wrapper.find('#gw-table-container').isVisible()).toBe(true);
});
......@@ -88,7 +88,7 @@ describe('monitoring-location/components/hydrograph/components/data-table.vue',
}
});
expect(wrapper.find('#iv-table-container').isVisible()).toBe(true);
expect(wrapper.find('#iv-primary-table-container').isVisible()).toBe(true);
expect(wrapper.find('#gw-table-container').isVisible()).toBe(false);
});
......@@ -124,7 +124,7 @@ describe('monitoring-location/components/hydrograph/components/data-table.vue',
}
});
expect(wrapper.find('#iv-table-container').isVisible()).toBe(false);
expect(wrapper.find('#iv-primary-table-container').isVisible()).toBe(false);
expect(wrapper.find('#gw-table-container').isVisible()).toBe(true);
});
......@@ -172,4 +172,44 @@ describe('monitoring-location/components/hydrograph/components/data-table.vue',
await wrapper.find('button').trigger('click');
expect(wrapper.findAllComponents(DownloadData)).toHaveLength(0);
});
it('Shows both IV primary and secondary parameter selection tables and GW data table', () => {
store = configureStore({
hydrographData: {
currentTimeRange: {
start: 1582560000000,
end: 1600620000000
},
primaryIVData: TEST_PRIMARY_IV_DATA,
secondaryIVData: TEST_SECONDARY_IV_DATA
},
groundwaterLevelData: {
all: [TEST_GW_LEVELS]
},
hydrographState: {
selectedParameterCode: '72019',
selectedIVMethodID: '90649'
}
});
wrapper = mount(DataTable, {
global: {
plugins: [
[ReduxConnectVue, {
store,
mapDispatchToPropsFactory: (actionCreators) => (dispatch) => bindActionCreators(actionCreators, dispatch),
mapStateToPropsFactory: createStructuredSelector
}]
],
provide: {
store: store
}
}
});
expect(wrapper.find('#iv-primary-table-container').isVisible()).toBe(true);
expect(wrapper.find('#iv-secondary-table-container').isVisible()).toBe(true);
expect(wrapper.find('#gw-table-container').isVisible()).toBe(true);
});
});
......@@ -2,7 +2,7 @@
<div id="iv-hydrograph-data-table-container">
<div
v-show="currentPrimaryIVData.IVData.length"
id="iv-table-container"
id="iv-primary-table-container"
>
<PaginatedTable
:data-set="currentPrimaryIVData.IVData"
......@@ -13,7 +13,7 @@
</div>
<div
v-show="currentSecondaryIVData.IVData.length"
id="iv-table-container"
id="iv-secondary-table-container"
>
<PaginatedTable
:data-set="currentSecondaryIVData.IVData"
......
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