messageSpanSamplesTable.spec.tsx 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import {render, screen} from 'sentry-test/reactTestingLibrary';
  2. import {MessageSpanSamplesTable} from 'sentry/views/performance/queues/destinationSummary/messageSpanSamplesTable';
  3. import {MessageActorType} from 'sentry/views/performance/queues/settings';
  4. describe('messageSpanSamplesTable', () => {
  5. it('renders consumer samples table', () => {
  6. render(
  7. <MessageSpanSamplesTable
  8. data={[]}
  9. isLoading={false}
  10. type={MessageActorType.CONSUMER}
  11. />
  12. );
  13. expect(screen.getByRole('table', {name: 'Span Samples'})).toBeInTheDocument();
  14. expect(screen.getByRole('columnheader', {name: 'Span ID'})).toBeInTheDocument();
  15. expect(screen.getByRole('columnheader', {name: 'Message ID'})).toBeInTheDocument();
  16. expect(
  17. screen.getByRole('columnheader', {name: 'Processing Time'})
  18. ).toBeInTheDocument();
  19. expect(screen.getByRole('columnheader', {name: 'Retries'})).toBeInTheDocument();
  20. expect(screen.getByRole('columnheader', {name: 'Status'})).toBeInTheDocument();
  21. });
  22. it('renders producer samples table', () => {
  23. render(
  24. <MessageSpanSamplesTable
  25. data={[]}
  26. isLoading={false}
  27. type={MessageActorType.PRODUCER}
  28. />
  29. );
  30. expect(screen.getByRole('table', {name: 'Span Samples'})).toBeInTheDocument();
  31. expect(screen.getByRole('columnheader', {name: 'Span ID'})).toBeInTheDocument();
  32. expect(screen.getByRole('columnheader', {name: 'Message ID'})).toBeInTheDocument();
  33. expect(screen.getByRole('columnheader', {name: 'Message Size'})).toBeInTheDocument();
  34. expect(screen.getByRole('columnheader', {name: 'Status'})).toBeInTheDocument();
  35. });
  36. });