2016-05-01 23:20:55 +05:30
|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
import { shallow } from 'enzyme';
|
|
|
|
|
|
|
|
import ChangePassword from 'components/profile/changePassword/ChangePassword';
|
|
|
|
|
|
|
|
describe('<ChangePassword />', () => {
|
2016-05-02 11:21:47 +05:30
|
|
|
it('renders two <Input /> components', () => {
|
2016-05-01 23:20:55 +05:30
|
|
|
const component = shallow(<ChangePassword onSubmit={() => {}} />);
|
|
|
|
|
2016-05-02 11:21:47 +05:30
|
|
|
expect(component.find('Input')).to.have.length(2);
|
2016-05-01 23:20:55 +05:30
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
it('should call onSubmit if passwords entered', () => {
|
|
|
|
const onSubmit = sinon.spy();
|
|
|
|
const component = shallow(<ChangePassword onSubmit={onSubmit} />);
|
|
|
|
|
|
|
|
component.find('Form').simulate('submit');
|
|
|
|
|
|
|
|
sinon.assert.calledOnce(onSubmit);
|
|
|
|
});
|
|
|
|
});
|