index.spec.tsx 967 B

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