Update validator.spec.ts

This commit is contained in:
Stephan Fabel 2022-11-10 08:15:46 -08:00 committed by GitHub
parent ab24d9775f
commit c599394f40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -2,6 +2,13 @@ import { domainFormat } from '@/utils/validator'
describe('validator', () => {
describe('domainFormat', () => {
describe('single character domain name', () => {
const domain = 'c.im'
it('should match', () => {
const res = domain.search(domainFormat)
expect(res).toEqual(0)
})
})
describe('string contains protocol', () => {
const domain = 'https://mastodon.social'
it('should not match', () => {