mirror of
https://github.com/grafana/grafana.git
synced 2025-02-11 08:05:43 -06:00
Chore: Fix flaky test in SpanGraph/index.test.tsx
(#61009)
This commit is contained in:
parent
ad1813da27
commit
2af79535bc
@ -50,4 +50,11 @@ describe('<TickLabels>', () => {
|
||||
expect(tick).toHaveStyle(`left: ${pos};`);
|
||||
});
|
||||
});
|
||||
it('shows the correct value above each tick', () => {
|
||||
expect(screen.getByText('0μs')).toBeTruthy();
|
||||
expect(screen.getByText('1.25ms')).toBeTruthy();
|
||||
expect(screen.getByText('2.5ms')).toBeTruthy();
|
||||
expect(screen.getByText('3.75ms')).toBeTruthy();
|
||||
expect(screen.getByText('5ms')).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
@ -19,8 +19,6 @@ import traceGenerator from '../../demo/trace-generators';
|
||||
import transformTraceData from '../../model/transform-trace-data';
|
||||
import { polyfill as polyfillAnimationFrame } from '../../utils/test/requestAnimationFrame';
|
||||
|
||||
import TickLabels from './TickLabels';
|
||||
|
||||
import SpanGraph, { SpanGraphProps, TIMELINE_TICK_INTERVAL } from './index';
|
||||
|
||||
describe('<SpanGraph>', () => {
|
||||
@ -60,12 +58,4 @@ describe('<SpanGraph>', () => {
|
||||
const tickLabelsDiv = screen.getByTestId('TickLabels');
|
||||
expect(getAllByTestId(tickLabelsDiv, 'tick').length).toBe(TIMELINE_TICK_INTERVAL + 1);
|
||||
});
|
||||
|
||||
it('renders <TickLabels /> with the correct value next to each tick', () => {
|
||||
render(<TickLabels numTicks={5} duration={1} />);
|
||||
expect(screen.getByText(/0.2/)).toBeTruthy();
|
||||
expect(screen.getByText(/0.4/)).toBeTruthy();
|
||||
expect(screen.getByText(/0.6/)).toBeTruthy();
|
||||
expect(screen.getByText(/0.8/)).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user