mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
* [APM] Avoid crashing transaction details page if trace duration is 0 * Remove snapshot
This commit is contained in:
parent
cf89c22149
commit
307e20a6a4
3 changed files with 26 additions and 2 deletions
|
@ -73,7 +73,7 @@ function TimelineAxis({ plotValues, agentMarks, traceRootDuration }) {
|
|||
}}
|
||||
/>
|
||||
|
||||
{traceRootDuration && (
|
||||
{traceRootDuration > 0 && (
|
||||
<LastTickValue
|
||||
x={xScale(traceRootDuration)}
|
||||
value={tickFormat(traceRootDuration)}
|
||||
|
|
|
@ -47,7 +47,7 @@ class VerticalLines extends PureComponent {
|
|||
style={{ stroke: colors.gray3 }}
|
||||
/>
|
||||
|
||||
{traceRootDuration && (
|
||||
{traceRootDuration > 0 && (
|
||||
<VerticalGridLines
|
||||
tickValues={[traceRootDuration]}
|
||||
style={{ stroke: colors.gray3 }}
|
||||
|
|
|
@ -44,4 +44,28 @@ describe('Timeline', () => {
|
|||
|
||||
expect(toJson(wrapper)).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('should not crash if traceRootDuration is 0', () => {
|
||||
const props = {
|
||||
traceRootDuration: 0,
|
||||
width: 1000,
|
||||
duration: 0,
|
||||
height: 116,
|
||||
margins: {
|
||||
top: 100,
|
||||
left: 50,
|
||||
right: 50,
|
||||
bottom: 0
|
||||
}
|
||||
};
|
||||
|
||||
const mountTimeline = () =>
|
||||
mount(
|
||||
<StickyContainer>
|
||||
<Timeline {...props} />
|
||||
</StickyContainer>
|
||||
);
|
||||
|
||||
expect(mountTimeline).not.toThrow();
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue