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

clean and add a couple tests

parent eea261b3
No related branches found
No related tags found
No related merge requests found
/**
* Hydrograph charting module.
*/
import {select, selectAll} from 'd3-selection';
import {select} from 'd3-selection';
import {createStructuredSelector} from 'reselect';
import config from 'ui/config.js';
......
import {
isVisible, getYLabel, getTitle,
getDescription, getTsTimeZone, getSecondaryYLabel} from './time-series-data';
getDescription, getTsTimeZone, getSecondaryYLabel, getQueryInformation} from './time-series-data';
const TEST_DATA = {
......@@ -334,4 +334,37 @@ describe('monitoring-location/components/hydrograph/time-series module', () => {
expect(result).toEqual('America/New_York');
});
});
describe('getQueryInformation', () => {
it('Returns the stored query information', () => {
const result = getQueryInformation(TEST_DATA);
const expectedObject = {
'current:P7D': {
notes: {
requestDT: 1483994767572,
'filter:timeRange': {
mode: 'PERIOD',
periodDays: 7,
modifiedSince: null
}
}
},
'current:P30D:00060': {
notes: {
requestDT: 1483994767572,
'filter:timeRange': {
mode: 'RANGE',
interval: {
start: 1483941600000,
end: 1486533600000
},
modifiedSince: null
}
}
}
};
expect(result).toEqual(expectedObject);
});
});
});
import {
getVariables,
getShowIVTimeSeries,
getSourceInfo,
getSiteCodes,
getCurrentVariableID,
......@@ -232,6 +233,11 @@ const TEST_DATA = {
}
},
ivTimeSeriesState: {
showIVTimeSeries: {
current: true,
compare: true,
median: false
},
currentIVVariableID: '45807197',
currentIVDateRange: 'P7D'
}
......@@ -830,6 +836,18 @@ describe('monitoring-location/selectors/time-series-selector', () => {
});
});
describe('getShowIVTimeSeries', () => {
const expectedObject = {
current: true,
compare: true,
median: false
};
it('Expects to return the selections for which time series are active', () => {
expect(getShowIVTimeSeries(TEST_DATA)).toEqual(expectedObject);
});
});
describe('getTSRequest', () => {
const TEST_DATA = {
ivTimeSeriesData: {
......
import {utcFormat} from 'd3-time-format';
import config from 'ui/config';
import {get} from 'ui/ajax';
import config from 'ui/config';
// Define Water Services root URL - use global variable if defined, otherwise
// use production.
......
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