emailVerificationModal.spec.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import {mountWithTheme} from 'sentry-test/enzyme';
  2. import EmailVerificationModal from 'app/components/modals/emailVerificationModal.tsx';
  3. describe('Email Verification Modal', function () {
  4. let wrapper;
  5. beforeEach(function () {
  6. wrapper = mountWithTheme(
  7. <EmailVerificationModal Body={p => p.children} Header={p => p.children} />,
  8. TestStubs.routerContext()
  9. );
  10. });
  11. it('renders', async function () {
  12. expect(wrapper.find('TextBlock').text()).toEqual(
  13. 'Please verify your email before taking this action, or go to your email settings.'
  14. );
  15. expect(
  16. wrapper.find('Link[data-test-id="email-settings-link"]').first().props('to').to
  17. ).toEqual('/settings/account/emails/');
  18. expect(wrapper.find('EmailAddresses')).toHaveLength(1);
  19. });
  20. it('renders with action param', async function () {
  21. wrapper = mountWithTheme(
  22. <EmailVerificationModal
  23. Body={p => p.children}
  24. Header={p => p.children}
  25. actionMessage="accepting the tenet"
  26. />,
  27. TestStubs.routerContext()
  28. );
  29. expect(wrapper.find('TextBlock').text()).toEqual(
  30. 'Please verify your email before accepting the tenet, or go to your email settings.'
  31. );
  32. });
  33. });