Skip to content

Commit

Permalink
Add tests for VirtualizedTraceView
Browse files Browse the repository at this point in the history
Signed-off-by: Kanahathi Mohideen <kpmfazal@gmail.com>
  • Loading branch information
MUI-Pop committed Feb 6, 2023
1 parent 4b74c6d commit c4e42e1
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { DEFAULT_HEIGHTS, VirtualizedTraceViewImpl } from './VirtualizedTraceVie
import traceGenerator from '../../../demo/trace-generators';
import transformTraceData from '../../../model/transform-trace-data';
import updateUiFindSpy from '../../../utils/update-ui-find';
import * as getLinks from '../../../model/link-patterns';

jest.mock('./SpanTreeOffset');
jest.mock('../../../utils/update-ui-find');
Expand Down Expand Up @@ -430,4 +431,22 @@ describe('<VirtualizedTraceViewImpl>', () => {
expect(focusUiFindMatchesMock).toHaveBeenLastCalledWith(trace, spanName, false);
});
});

describe('linksGetter()', () => {
let getLinksSpy;

beforeAll(() => {
getLinksSpy = jest.spyOn(getLinks, 'default');
});

afterAll(() => {
getLinksSpy.mockRestore();
});

it('calls getLinks with expected params', () => {
const span = trace.spans[1];
instance.linksGetter(span, span.tags, 0);
expect(getLinksSpy).toHaveBeenCalledWith(span, span.tags, 0, trace);
});
});
});

0 comments on commit c4e42e1

Please sign in to comment.