You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
484 B
16 lines
484 B
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)
|
|
})
|
|
})
|