mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-09-18 09:45:36 +05:30
24 lines
673 B
React
24 lines
673 B
React
|
import React from 'react';
|
||
|
|
||
|
import { shallow } from 'enzyme';
|
||
|
|
||
|
import ChangePassword from 'components/profile/changePassword/ChangePassword';
|
||
|
|
||
|
describe('<ChangePassword />', () => {
|
||
|
it('renders two <LabeledInput /> components', () => {
|
||
|
const component = shallow(<ChangePassword onSubmit={() => {}} />);
|
||
|
|
||
|
expect(component.find('LabeledInput')).to.have.length(2);
|
||
|
});
|
||
|
|
||
|
|
||
|
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);
|
||
|
});
|
||
|
});
|