Files
supabase/apps/studio/components/interfaces/ProjectCreation/ProjectCreation.test.ts
Joshen Lim 6e2a7feee7 Break down new project page into smaller components (#39812)
* Break down new project page into smaller components

* Fix types

* Address comments

* Add min length check for project name in project settings

* Fix tests
2025-10-27 14:04:56 +08:00

11 lines
530 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)
})