fleet/frontend/pages/ForgotPasswordPage/ForgotPasswordPage.tests.jsx
Mike Stone 5ea9115a95 Forgot password submit (#168)
* Authentication middleware

* API client refactor

* Configure API client to make forgot_password requests

* Successfully submit forgot password form

* Display server errors for unknown email address
2016-09-16 09:55:46 -04:00

22 lines
709 B
JavaScript

import React from 'react';
import expect from 'expect';
import { mount } from 'enzyme';
import { ForgotPasswordPage } from './ForgotPasswordPage';
describe('ForgotPasswordPage - component', () => {
it('renders the ForgotPasswordForm when there is no email prop', () => {
const page = mount(<ForgotPasswordPage />);
expect(page.find('ForgotPasswordForm').length).toEqual(1);
});
it('renders the email sent text when the email prop is present', () => {
const email = 'hi@thegnar.co';
const page = mount(<ForgotPasswordPage email={email} />);
expect(page.find('ForgotPasswordForm').length).toEqual(0);
expect(page.text()).toInclude(`An email was sent to ${email}.`);
});
});