breadcrumb.spec.tsx 995 B

123456789101112131415161718192021222324252627282930313233
  1. import {render, screen} from 'sentry-test/reactTestingLibrary';
  2. import {Breadcrumb} from 'sentry/components/profiling/breadcrumb';
  3. describe('Breadcrumb', function () {
  4. it('renders the profiling link', function () {
  5. const organization = TestStubs.Organization();
  6. render(
  7. <Breadcrumb
  8. organization={organization}
  9. trails={[
  10. {type: 'landing', payload: {query: {}}},
  11. {
  12. type: 'flamechart',
  13. payload: {
  14. query: {},
  15. transaction: 'foo',
  16. profileId: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
  17. projectSlug: 'bar',
  18. tab: 'flamechart',
  19. },
  20. },
  21. ]}
  22. />
  23. );
  24. expect(screen.getByText('Profiling')).toBeInTheDocument();
  25. expect(screen.getByRole('link', {name: 'Profiling'})).toHaveAttribute(
  26. 'href',
  27. `/organizations/${organization.slug}/profiling/`
  28. );
  29. expect(screen.getByText('foo')).toBeInTheDocument();
  30. });
  31. });