index.spec.tsx 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. import {EventFixture} from 'sentry-fixture/event';
  2. import {GroupFixture} from 'sentry-fixture/group';
  3. import {LocationFixture} from 'sentry-fixture/locationFixture';
  4. import {OrganizationFixture} from 'sentry-fixture/organization';
  5. import {render} from 'sentry-test/reactTestingLibrary';
  6. import QuickTrace from 'sentry/views/issueDetails/quickTrace';
  7. describe('IssueQuickTrace', () => {
  8. const defaultProps = {
  9. organization: OrganizationFixture({features: ['performance-view']}),
  10. event: EventFixture({contexts: {trace: {trace_id: 100}}}),
  11. group: GroupFixture(),
  12. location: LocationFixture(),
  13. };
  14. it('renders nothing without performance-view flag', () => {
  15. const {container} = render(
  16. <QuickTrace {...defaultProps} organization={OrganizationFixture()} />
  17. );
  18. expect(container).toBeEmptyDOMElement();
  19. });
  20. it('renders nothing if event does not have a trace context', () => {
  21. const {container} = render(
  22. <QuickTrace {...defaultProps} event={EventFixture({contexts: {}})} />
  23. );
  24. expect(container).toBeEmptyDOMElement();
  25. });
  26. });