Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import {
YAxis,
HorizontalGridLines,
LineSeries,
AreaSeries
AreaSeries,
VerticalRectSeries
} from 'react-vis';
import PropTypes from 'prop-types';
import React, { PureComponent } from 'react';
Expand Down Expand Up @@ -56,13 +57,14 @@ class StaticPlot extends PureComponent {
case 'areaMaxHeight':
const yMax = last(plotValues.yTickValues);
const data = serie.data.map(p => ({
x0: p.x0,
x: p.x,
y0: 0,
y: p.y ? yMax : null
y: yMax
}));

return (
<AreaSeries
<VerticalRectSeries
getNull={d => d.y !== null}
key={serie.title}
xType="time"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ import {
getEmptySerie
} from '../../../../../store/selectors/chartSelectors';

function getXValueByIndex(index) {
return responseWithData.responseTimes.avg[index].x;
}

describe('when response has data', () => {
let wrapper;
let onHover;
Expand All @@ -26,7 +30,6 @@ describe('when response has data', () => {

beforeEach(() => {
const series = getResponseTimeSeries(responseWithData);

onHover = jest.fn();
onMouseLeave = jest.fn();
onSelectionEnd = jest.fn();
Expand Down Expand Up @@ -166,7 +169,7 @@ describe('when response has data', () => {
});

it('should call onHover', () => {
expect(onHover).toHaveBeenCalledWith(responseWithData.dates[index]);
expect(onHover).toHaveBeenCalledWith(getXValueByIndex(index));
});
});

Expand All @@ -178,9 +181,9 @@ describe('when response has data', () => {
});

// Simulate hovering over multiple buckets
wrapper.setProps({ hoverX: responseWithData.dates[13] });
wrapper.setProps({ hoverX: responseWithData.dates[14] });
wrapper.setProps({ hoverX: responseWithData.dates[15] });
wrapper.setProps({ hoverX: getXValueByIndex(13) });
wrapper.setProps({ hoverX: getXValueByIndex(14) });
wrapper.setProps({ hoverX: getXValueByIndex(15) });
});

it('should display tooltip', () => {
Expand Down
Loading