Skip to content
Snippets Groups Projects
Commit 4c7c898d authored by Bucknell, Mary S.'s avatar Bucknell, Mary S.
Browse files

Updated legend and its test for the new store state

parent e9c93d91
No related branches found
No related tags found
No related merge requests found
...@@ -192,7 +192,7 @@ const uniqueClassesSelector = memoize(tsKey => createSelector( ...@@ -192,7 +192,7 @@ const uniqueClassesSelector = memoize(tsKey => createSelector(
* Select attributes from the state useful for legend creation * Select attributes from the state useful for legend creation
*/ */
const legendDisplaySelector = createSelector( const legendDisplaySelector = createSelector(
(state) => state.showSeries, (state) => state.timeseriesState.showSeries,
currentVariableTimeSeriesSelector('median'), currentVariableTimeSeriesSelector('median'),
methodsSelector, methodsSelector,
uniqueClassesSelector('current'), uniqueClassesSelector('current'),
......
...@@ -165,11 +165,13 @@ describe('Legend module', () => { ...@@ -165,11 +165,13 @@ describe('Legend module', () => {
} }
} }
}, },
currentVariableID: '45807197', timeseriesState: {
showSeries: { currentVariableID: '45807197',
current: true, showSeries: {
compare: true, current: true,
median: true compare: true,
median: true
}
} }
}; };
...@@ -199,7 +201,10 @@ describe('Legend module', () => { ...@@ -199,7 +201,10 @@ describe('Legend module', () => {
it('Should return markers for a different selected variable', () => { it('Should return markers for a different selected variable', () => {
const newData = { const newData = {
...TEST_DATA, ...TEST_DATA,
currentVariableID: '45807202' timeseriesState: {
...TEST_DATA.timeseriesState,
currentVariableID: '45807202'
}
}; };
const result = legendMarkerRowsSelector(newData); const result = legendMarkerRowsSelector(newData);
...@@ -216,11 +221,14 @@ describe('Legend module', () => { ...@@ -216,11 +221,14 @@ describe('Legend module', () => {
it('Should return markers only for time series shown', () => { it('Should return markers only for time series shown', () => {
const newData = { const newData = {
...TEST_DATA, ...TEST_DATA,
currentVariableID: '45807202', timeseriesState: {
showSeries: { ...TEST_DATA.timeseriesState,
'current': true, currentVariableID: '45807202',
'compare': false, showSeries: {
'median': true 'current': true,
'compare': false,
'median': true
}
} }
}; };
......
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