emailVerificationModal.spec.tsx 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import {render, screen} from 'sentry-test/reactTestingLibrary';
  2. import EmailVerificationModal from 'sentry/components/modals/emailVerificationModal';
  3. describe('Email Verification Modal', function () {
  4. it('renders', function () {
  5. render(
  6. <EmailVerificationModal
  7. Body={(p => p.children) as any}
  8. Header={(p => p.children) as any}
  9. />
  10. );
  11. const message = screen.getByText('Please verify your email before');
  12. expect(message.parentElement).toHaveTextContent(
  13. 'Please verify your email before taking this action, or go to your email settings.'
  14. );
  15. expect(screen.getByTestId('email-settings-link')).toHaveAttribute(
  16. 'href',
  17. '/settings/account/emails/'
  18. );
  19. expect(screen.getByText('Email Addresses')).toBeInTheDocument();
  20. });
  21. it('renders with action param', function () {
  22. const actionMessage = 'accepting the tenet';
  23. render(
  24. <EmailVerificationModal
  25. Body={(p => p.children) as any}
  26. Header={(p => p.children) as any}
  27. actionMessage={actionMessage}
  28. />
  29. );
  30. const message = screen.getByText('Please verify your email before');
  31. expect(message.parentElement).toHaveTextContent(
  32. `Please verify your email before ${actionMessage}, or go to your email settings.`
  33. );
  34. });
  35. });