123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- import {render, screen} from 'sentry-test/reactTestingLibrary';
- import EmailVerificationModal from 'sentry/components/modals/emailVerificationModal';
- describe('Email Verification Modal', function () {
- it('renders', function () {
- MockApiClient.addMockResponse({
- url: '/users/me/emails/',
- body: [],
- });
- render(
- <EmailVerificationModal
- Body={(p => p.children) as any}
- Header={(p => p.children) as any}
- />
- );
- const message = screen.getByText(
- 'Please verify your email before taking this action',
- {exact: false}
- );
- 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';
- MockApiClient.addMockResponse({
- url: '/users/me/emails/',
- body: [],
- });
- 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 accepting the tenet',
- {exact: false}
- );
- expect(message.parentElement).toHaveTextContent(
- `Please verify your email before ${actionMessage}, or go to your email settings.`
- );
- });
- });
|