index.spec.tsx 913 B

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