mirror of
https://github.com/ruvnet/RuVector.git
synced 2026-05-31 13:29:29 +00:00
Major additions: - Complete Next.js studio application with 1600+ components - Docker support (Dockerfile.combined, docker-compose.yml) - GCP deployment documentation and benchmarks - SQL benchmark scripts for performance testing - Sentry integration for monitoring - Comprehensive test suite and mocks Studio features: - Dashboard and admin interfaces - Data visualization components - Authentication and user management - API integration with RuVector backend - Static data and public assets 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
51 lines
1.7 KiB
TypeScript
51 lines
1.7 KiB
TypeScript
import { urlRegex } from 'components/interfaces/Auth/Auth.constants'
|
|
import { describe, it, expect } from 'vitest'
|
|
|
|
describe('Auth.constants: urlRegex', () => {
|
|
it('should match valid URLs', () => {
|
|
const validUrls = [
|
|
'http://domain.com',
|
|
'https://supabase.io',
|
|
'https://new-domain-vercel.com',
|
|
'www.test-domain.com',
|
|
'exp://exp.host/some-app',
|
|
'exp://exp.host/some-app?release-channel=default',
|
|
'https://supabase.com/dashboard',
|
|
'http://localhost:3000',
|
|
'https://supabase.com?name=test',
|
|
'https://supabase.com?name=test&description=hello&page=2',
|
|
'https://supabase*.com',
|
|
'https://supabase.com/*',
|
|
'https://new-*-domain.com/*',
|
|
'https://new-*-domain.com/*/*/*',
|
|
'https://sub-*-domain.new-*-domain.com/*/*/*',
|
|
]
|
|
|
|
validUrls.forEach((url) => {
|
|
expect(urlRegex().test(url)).toBe(true)
|
|
})
|
|
})
|
|
|
|
it('should not match invalid URLs', () => {
|
|
const invalidUrls = ['supabase', 'mailto:test@gmail.com', 'hello world.com', 'email@domain.com']
|
|
|
|
const failingInvalidUrls = invalidUrls.filter((url) => urlRegex().test(url))
|
|
if (failingInvalidUrls.length > 0) {
|
|
console.log('Failing invalid URLs:', failingInvalidUrls)
|
|
}
|
|
|
|
invalidUrls.forEach((url) => {
|
|
expect(urlRegex().test(url)).toBe(false)
|
|
})
|
|
})
|
|
|
|
it('should not match simple domain URLs when excludeSimpleDomains is true', () => {
|
|
const simpleDomainUrl = 'smtp-pulse.com'
|
|
expect(urlRegex({ excludeSimpleDomains: true }).test(simpleDomainUrl)).toBe(false)
|
|
})
|
|
|
|
it('should match simple domain URLs when excludeSimpleDomains is false', () => {
|
|
const simpleDomainUrl = 'smtp-pulse.com'
|
|
expect(urlRegex({ excludeSimpleDomains: false }).test(simpleDomainUrl)).toBe(true)
|
|
})
|
|
})
|