mirror of
https://github.com/empayre/fleet.git
synced 2024-11-07 09:18:59 +00:00
5ea9115a95
* 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
22 lines
709 B
JavaScript
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}.`);
|
|
});
|
|
});
|
|
|