mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-22 15:17:53 -05:00
test registration response validation function
This commit is contained in:
parent
469db4dc36
commit
7ec4af6c10
1 changed files with 7 additions and 0 deletions
|
@ -139,4 +139,11 @@ describe('unit test lib/validate.js', () => {
|
|||
response = validate.validateEmailLocally('much."more unusual"@example.com');
|
||||
expect(response).toEqual({valid: false, errMsgId: 'registration.validationEmailInvalid'});
|
||||
});
|
||||
|
||||
test('get responseErrorMsg', () => {
|
||||
let response = validate.responseErrorMsg('username', 'bad username');
|
||||
expect(response).toEqual('registration.errorBadUsername');
|
||||
response = validate.responseErrorMsg('password', 'Ensure this value has at least 6 characters (it has 3).');
|
||||
expect(response).toEqual('registration.errorPasswordTooShort');
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue