index.spec.tsx 874 B

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