transforms.test.ts 627 B

1234567891011121314151617
  1. import { MutableDataFrame } from '@grafana/data';
  2. import { traceFrameFields, zipkinResponse } from './testData';
  3. import { transformResponse, transformToZipkin } from './transforms';
  4. describe('transformResponse', () => {
  5. it('transforms response', () => {
  6. const dataFrame = transformResponse(zipkinResponse);
  7. expect(dataFrame.fields).toMatchObject(traceFrameFields);
  8. });
  9. it('converts dataframe to ZipkinSpan[]', () => {
  10. const dataFrame = transformResponse(zipkinResponse);
  11. const response = transformToZipkin(new MutableDataFrame(dataFrame));
  12. expect(response).toMatchObject(zipkinResponse);
  13. });
  14. });