Ivan - Fix frontend tests

This commit is contained in:
ivan 2017-06-28 10:06:21 -03:00
parent 989c2e35f8
commit 46610ad336
2 changed files with 5 additions and 5 deletions

View File

@ -95,7 +95,7 @@ describe('Login/Recover Widget', function () {
failMessage: 'INVALID_CREDENTIALS'
}
});
expect(loginForm.props.errors).to.deep.equal({password: 'Invalid password'});
expect(loginForm.props.errors).to.deep.equal({password: 'ERROR_PASSWORD'});
expect(loginForm.props.loading).to.equal(false);
});
@ -160,7 +160,7 @@ describe('Login/Recover Widget', function () {
component.refs.recoverForm.refs.email.focus.reset();
component.onRecoverPasswordFail();
expect(recoverForm.props.errors).to.deep.equal({email: 'Email does not exist'});
expect(recoverForm.props.errors).to.deep.equal({email: 'EMAIL_NOT_EXIST'});
expect(recoverForm.props.loading).to.equal(false);
expect(component.refs.recoverForm.refs.email.focus).to.have.been.called;
});
@ -175,7 +175,7 @@ describe('Login/Recover Widget', function () {
expect(recoverForm.props.loading).to.equal(false);
expect(message).to.not.equal(null);
expect(message.props.type).to.equal('info');
expect(message.props.children).to.equal('An email with recover instructions has been sent.');
expect(message.props.children).to.equal('RECOVER_SENT');
});
it('should show front side if \'Back to login form\' link is clicked', function () {

View File

@ -59,7 +59,7 @@ describe('Recover Password form', function () {
let message = TestUtils.scryRenderedComponentsWithType(component, Message)[0];
expect(message).to.not.equal(null);
expect(message.props.type).to.equal('error');
expect(message.props.children).to.equal('Invalid recover data');
expect(message.props.children).to.equal('INVALID_RECOVER');
});
it('should show message when recover success', function () {
@ -69,6 +69,6 @@ describe('Recover Password form', function () {
let message = TestUtils.scryRenderedComponentsWithType(component, Message)[0];
expect(message).to.not.equal(null);
expect(message.props.type).to.equal('success');
expect(message.props.children).to.equal('Password recovered successfully');
expect(message.props.children).to.equal('VALID_RECOVER');
});
});