messageSpanSamplesTable.spec.tsx 1.6 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import {render, screen} from 'sentry-test/reactTestingLibrary';
  2. import {MessageSpanSamplesTable} from 'sentry/views/insights/queues/components/tables/messageSpanSamplesTable';
  3. import {MessageActorType} from 'sentry/views/insights/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(screen.getByRole('columnheader', {name: 'Span Duration'})).toBeInTheDocument();
  17. expect(screen.getByRole('columnheader', {name: 'Retries'})).toBeInTheDocument();
  18. expect(screen.getByRole('columnheader', {name: 'Status'})).toBeInTheDocument();
  19. });
  20. it('renders producer samples table', () => {
  21. render(
  22. <MessageSpanSamplesTable
  23. data={[]}
  24. isLoading={false}
  25. type={MessageActorType.PRODUCER}
  26. />
  27. );
  28. expect(screen.getByRole('table', {name: 'Span Samples'})).toBeInTheDocument();
  29. expect(screen.getByRole('columnheader', {name: 'Span ID'})).toBeInTheDocument();
  30. expect(screen.getByRole('columnheader', {name: 'Message ID'})).toBeInTheDocument();
  31. expect(screen.getByRole('columnheader', {name: 'Message Size'})).toBeInTheDocument();
  32. expect(screen.getByRole('columnheader', {name: 'Status'})).toBeInTheDocument();
  33. });
  34. });