vue commit
This commit is contained in:
15
tests/unit/utils/validate.spec.ts
Normal file
15
tests/unit/utils/validate.spec.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { isValidUsername, isExternal } from '@/utils/validate';
|
||||
|
||||
describe('Utils:validate', () => {
|
||||
it('isValidUsername', () => {
|
||||
expect(isValidUsername('admin')).toBe(true);
|
||||
expect(isValidUsername('editor')).toBe(true);
|
||||
expect(isValidUsername('xxxx')).toBe(false);
|
||||
});
|
||||
|
||||
it('isExternal', () => {
|
||||
expect(isExternal('https://www.armour.com/')).toBe(true);
|
||||
expect(isExternal('mailto:someone@test.com')).toBe(true);
|
||||
expect(isExternal('123aBC')).toBe(false);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user