mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-15 05:37:22 +01:00
Minimum password length + Static Pages fixes (#11474)
* password min length: server + client side registering * tweak text, add tests * misc * use red border for invalid inputs * fix auth form for groups * remove default firefox box shadown on invalid elements * fix css in authForm * fix margings * misc fixes to forms and buttons * fix typo
This commit is contained in:
@@ -326,6 +326,24 @@ describe('POST /user/auth/local/register', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('requires minimum length for the password', async () => {
|
||||
const username = generateRandomUserName();
|
||||
const email = `${username}@example.com`;
|
||||
const password = '1234567';
|
||||
const confirmPassword = '1234567';
|
||||
|
||||
await expect(api.post('/user/auth/local/register', {
|
||||
username,
|
||||
email,
|
||||
password,
|
||||
confirmPassword,
|
||||
})).to.eventually.be.rejected.and.eql({
|
||||
code: 400,
|
||||
error: 'BadRequest',
|
||||
message: t('invalidReqParams'),
|
||||
});
|
||||
});
|
||||
|
||||
it('requires a username', async () => {
|
||||
const email = `${generateRandomUserName()}@example.com`;
|
||||
const password = 'password';
|
||||
|
||||
Reference in New Issue
Block a user