Update username max/min lengths
This commit is contained in:
parent
a024ee4b96
commit
fbd7292663
3 changed files with 21 additions and 18 deletions
|
@ -12,20 +12,20 @@ describe('Username', () => {
|
|||
it('matches invalid username searches', () => {
|
||||
assert.strictEqual(getUsernameFromSearch('username!'), 'username!');
|
||||
assert.strictEqual(getUsernameFromSearch('1username'), '1username');
|
||||
assert.strictEqual(getUsernameFromSearch('us'), 'us');
|
||||
assert.strictEqual(getUsernameFromSearch('use'), 'use');
|
||||
assert.strictEqual(
|
||||
getUsernameFromSearch('username901234567890123456'),
|
||||
'username901234567890123456'
|
||||
getUsernameFromSearch('username9012345678901234567'),
|
||||
'username9012345678901234567'
|
||||
);
|
||||
});
|
||||
|
||||
it('matches valid username searches', () => {
|
||||
assert.strictEqual(getUsernameFromSearch('username_34'), 'username_34');
|
||||
assert.strictEqual(getUsernameFromSearch('u5ername'), 'u5ername');
|
||||
assert.strictEqual(getUsernameFromSearch('use'), 'use');
|
||||
assert.strictEqual(getUsernameFromSearch('user'), 'user');
|
||||
assert.strictEqual(
|
||||
getUsernameFromSearch('username90123456789012345'),
|
||||
'username90123456789012345'
|
||||
getUsernameFromSearch('username901234567890123456'),
|
||||
'username901234567890123456'
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -57,15 +57,16 @@ describe('Username', () => {
|
|||
it('does not match invalid username searches', () => {
|
||||
assert.isFalse(isValidUsername('username!'));
|
||||
assert.isFalse(isValidUsername('1username'));
|
||||
assert.isFalse(isValidUsername('us'));
|
||||
assert.isFalse(isValidUsername('username901234567890123456'));
|
||||
assert.isFalse(isValidUsername('use'));
|
||||
assert.isFalse(isValidUsername('username9012345678901234567'));
|
||||
});
|
||||
|
||||
it('matches valid usernames', () => {
|
||||
assert.isTrue(isValidUsername('username_34'));
|
||||
assert.isTrue(isValidUsername('u5ername'));
|
||||
assert.isTrue(isValidUsername('use'));
|
||||
assert.isTrue(isValidUsername('username90123456789012345'));
|
||||
assert.isTrue(isValidUsername('_username'));
|
||||
assert.isTrue(isValidUsername('user'));
|
||||
assert.isTrue(isValidUsername('username901234567890123456'));
|
||||
});
|
||||
|
||||
it('does not match valid and invalid usernames with @ prefix or suffix', () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue