breadcrumb.spec.tsx 1.0 KB

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