mirror of
https://github.com/supabase/supabase.git
synced 2026-05-07 17:30:25 -04:00
4a0bb36ca8
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
12 lines
531 B
TypeScript
12 lines
531 B
TypeScript
import { expect, test } from 'vitest'
|
|
|
|
import { DATABASE_PASSWORD_REGEX } from './ProjectCreation.constants'
|
|
|
|
test('Regex test to surface if password contains @, : or /', () => {
|
|
expect(!'teststring'.match(DATABASE_PASSWORD_REGEX)).toEqual(false)
|
|
expect(!'test@string'.match(DATABASE_PASSWORD_REGEX)).toEqual(true)
|
|
expect(!'te:ststring'.match(DATABASE_PASSWORD_REGEX)).toEqual(true)
|
|
expect(!`tests/tring`.match(DATABASE_PASSWORD_REGEX)).toEqual(true)
|
|
expect(!'!#$%^&*()'.match(DATABASE_PASSWORD_REGEX)).toEqual(false)
|
|
})
|