detailedError.spec.tsx 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import {render} from 'sentry-test/reactTestingLibrary';
  2. import DetailedError from 'sentry/components/errors/detailedError';
  3. describe('DetailedError', function () {
  4. it('renders', function () {
  5. const {container} = render(
  6. <DetailedError heading="Error heading" message={<div>Message</div>} />
  7. );
  8. expect(container).toSnapshot();
  9. });
  10. it('renders with "Retry" button', function () {
  11. const {container} = render(
  12. <DetailedError
  13. onRetry={() => {}}
  14. heading="Error heading"
  15. message={<div>Message</div>}
  16. />
  17. );
  18. expect(container).toSnapshot();
  19. });
  20. it('can hide support links', function () {
  21. const {container} = render(
  22. <DetailedError
  23. hideSupportLinks
  24. onRetry={() => {}}
  25. heading="Error heading"
  26. message={<div>Message</div>}
  27. />
  28. );
  29. expect(container).toSnapshot();
  30. });
  31. it('hides footer when no "Retry" and no support links', function () {
  32. const {container} = render(
  33. <DetailedError
  34. hideSupportLinks
  35. heading="Error heading"
  36. message={<div>Message</div>}
  37. />
  38. );
  39. expect(container).toSnapshot();
  40. });
  41. });