use class instead of id for identifying errorMsg in test

This commit is contained in:
Ben Wheeler 2019-10-23 10:36:20 -04:00
parent 6e83c496c8
commit f713298d37
2 changed files with 3 additions and 3 deletions

View file

@ -38,7 +38,7 @@ class RegistrationErrorStep extends React.Component {
<FormattedMessage id="registration.cantCreateAccount" />
</p>
{this.props.errorMsg && (
<p className="join-flow-instructions" id="registration-error-msg">
<p className="join-flow-instructions registration-error-msg">
{this.props.errorMsg}
</p>
)}

View file

@ -33,7 +33,7 @@ describe('RegistrationErrorStep', () => {
};
const joinFlowStepWrapper = getRegistrationErrorStepWrapper(props).find(JoinFlowStep);
const joinFlowStepInstance = joinFlowStepWrapper.dive();
const errMsgElement = joinFlowStepInstance.find('#registration-error-msg');
const errMsgElement = joinFlowStepInstance.find('.registration-error-msg');
expect(errMsgElement).toHaveLength(1);
expect(errMsgElement.text()).toEqual('halp there is a errors!!');
});
@ -45,7 +45,7 @@ describe('RegistrationErrorStep', () => {
};
const joinFlowStepWrapper = getRegistrationErrorStepWrapper(props).find(JoinFlowStep);
const joinFlowStepInstance = joinFlowStepWrapper.dive();
const errMsgElement = joinFlowStepInstance.find('#registration-error-msg');
const errMsgElement = joinFlowStepInstance.find('.registration-error-msg');
expect(errMsgElement).toHaveLength(0);
});