validate.spec.js 748 B

1234567891011121314151617
  1. import { validUsername, isExternal } from '@/utils/validate.js'
  2. // describe('Utils:validate', () => {
  3. // it('validUsername', () => {
  4. // expect(validUsername('admin')).toBe(true)
  5. // expect(validUsername('editor')).toBe(true)
  6. // expect(validUsername('xxxx')).toBe(false)
  7. // })
  8. // it('isExternal', () => {
  9. // expect(isExternal('https://github.com/PanJiaChen/vue-element-admin')).toBe(true)
  10. // expect(isExternal('http://github.com/PanJiaChen/vue-element-admin')).toBe(true)
  11. // expect(isExternal('github.com/PanJiaChen/vue-element-admin')).toBe(false)
  12. // expect(isExternal('/dashboard')).toBe(false)
  13. // expect(isExternal('./dashboard')).toBe(false)
  14. // expect(isExternal('dashboard')).toBe(false)
  15. // })
  16. // })