1234567891011121314151617181920212223242526272829303132333435363738 |
- import {render, screen} from 'sentry-test/reactTestingLibrary';
- import EmailVerificationModal from 'sentry/components/modals/emailVerificationModal';
- describe('Email Verification Modal', function () {
- it('renders', function () {
- render(
- <EmailVerificationModal
- Body={(p => p.children) as any}
- Header={(p => p.children) as any}
- />
- );
- const message = screen.getByText('Please verify your email before');
- expect(message.parentElement).toHaveTextContent(
- 'Please verify your email before taking this action, or go to your email settings.'
- );
- expect(screen.getByTestId('email-settings-link')).toHaveAttribute(
- 'href',
- '/settings/account/emails/'
- );
- expect(screen.getByText('Email Addresses')).toBeInTheDocument();
- });
- it('renders with action param', function () {
- const actionMessage = 'accepting the tenet';
- render(
- <EmailVerificationModal
- Body={(p => p.children) as any}
- Header={(p => p.children) as any}
- actionMessage={actionMessage}
- />
- );
- const message = screen.getByText('Please verify your email before');
- expect(message.parentElement).toHaveTextContent(
- `Please verify your email before ${actionMessage}, or go to your email settings.`
- );
- });
- });
|