getTraceKnownDataDetails.spec.tsx 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. import {traceKnownDataValues} from 'sentry/components/events/contexts/trace';
  2. import {getTraceKnownDataDetails} from 'sentry/components/events/contexts/trace/getTraceKnownDataDetails';
  3. import {traceMockData} from './index.spec';
  4. describe('getTraceKnownDataDetails', function () {
  5. it('returns values and according to the parameters', function () {
  6. const allKnownData: ReturnType<typeof getTraceKnownDataDetails>[] = [];
  7. for (const type of Object.keys(traceKnownDataValues)) {
  8. const traceKnownData = getTraceKnownDataDetails({
  9. type: traceKnownDataValues[type],
  10. data: traceMockData,
  11. organization: TestStubs.Organization(),
  12. event: TestStubs.Event(),
  13. });
  14. if (!traceKnownData) {
  15. continue;
  16. }
  17. allKnownData.push(traceKnownData);
  18. }
  19. expect(allKnownData).toEqual([
  20. {subject: 'Status', value: 'unknown'},
  21. {subject: 'Trace ID', value: '61d2d7c5acf448ffa8e2f8f973e2cd36'},
  22. {subject: 'Span ID', value: 'a5702f287954a9ef'},
  23. {subject: 'Parent Span ID', value: 'b23703998ae619e7'},
  24. {subject: 'Operation Name', value: 'something'},
  25. ]);
  26. });
  27. });