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

Fixed broken tests

parent abb0ecdc
No related branches found
No related tags found
No related merge requests found
......@@ -24,7 +24,7 @@ export const getCurrentTimeSeriesPoints = createSelector(
return zip(
timeSeries.properties.result,
timeSeries.properties.timeStep.map((timeStep) => {
return new DateTime.fromISO(timeStep, ).toMillis();
return new DateTime.fromISO(timeStep, {zone: 'UTC'}).toMillis();
}),
timeSeries.properties.nilReason,
timeSeries.properties.approvals,
......@@ -109,7 +109,6 @@ export const getCursorEpochTime = createSelector(
(cursorOffset, xScale) => {
if (!cursorOffset) {
console.log('')
return xScale.domain()[1];
}
return xScale.domain()[0] + cursorOffset;
......
......@@ -140,8 +140,8 @@ describe('time-series-data module', () => {
});
describe('getCursorEpochTime', () => {
it('should return null if cursor offset is not set', () => {
expect(getCursorEpochTime(TEST_STATE)).toBeNull();
it('should return latest time if cursor offset is not set', () => {
expect(getCursorEpochTime(TEST_STATE)).toEqual(1515110400000);
});
it('should return the epoch time of the offset', () => {
......@@ -156,8 +156,15 @@ describe('time-series-data module', () => {
});
describe('getDataAtCursor', () => {
it('should return null if cursor offset is not set', () => {
expect(getDataAtCursor(TEST_STATE)).toBeNull();
it('should return last point if cursor offset is not set', () => {
expect(getDataAtCursor(TEST_STATE)).toEqual({
value: '3.2',
dateTime: 1515110400000,
approvals: ['Approved'],
nilReason: null,
qualifiers: ['ICE'],
grades: ['60']
});
});
it('should return the point nearest the cursor offset', () => {
......@@ -174,7 +181,6 @@ describe('time-series-data module', () => {
nilReason: 'AA',
qualifiers: null,
grades: ['50']
});
});
});
......
......@@ -379,8 +379,8 @@ describe('Hydrograph tooltip module', () => {
svg.call(createTooltipFocus, store);
expect(svg.selectAll('.focus-line').size()).toBe(1);
expect(svg.selectAll('circle').size()).toBe(2);
expect(svg.select('.focus').size()).toBe(1);
expect(svg.selectAll('.focus-circle').size()).toBe(2);
expect(svg.select('.focus-overlay').size()).toBe(1);
});
it('Focus circles and line are displayed if cursor is set', () => {
......@@ -408,8 +408,9 @@ describe('Hydrograph tooltip module', () => {
svg.call(createTooltipFocus, store);
expect(svg.select('.focus:first-child').style('display')).not.toBe('none');
expect(svg.select('.focus:nth-child(2)').style('display')).not.toBe('none');
expect(svg.selectAll('.focus-line').size()).toBe(1);
expect(svg.selectAll('.focus-circle').size()).toBe(2);
expect(svg.select('.focus-overlay').size()).toBe(1);
});
});
});
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