mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-11-06 08:11:20 +05:30
25 lines
716 B
JavaScript
25 lines
716 B
JavaScript
import expect from 'unexpected';
|
|
import React from 'react';
|
|
|
|
import { shallow } from 'enzyme';
|
|
|
|
import ChangePassword from 'components/profile/changePassword/ChangePassword';
|
|
|
|
describe('<ChangePassword />', () => {
|
|
it('renders two <Input /> components', () => {
|
|
const component = shallow(<ChangePassword onSubmit={() => {}} />);
|
|
|
|
expect(component.find('Input'), 'to satisfy', {length: 2});
|
|
});
|
|
|
|
|
|
it('should call onSubmit if passwords entered', () => {
|
|
const onSubmit = sinon.spy().named('onSubmit');
|
|
const component = shallow(<ChangePassword onSubmit={onSubmit} />);
|
|
|
|
component.find('Form').simulate('submit');
|
|
|
|
expect(onSubmit, 'was called');
|
|
});
|
|
});
|