mirror of
https://github.com/supabase/supabase.git
synced 2026-07-03 12:14:26 +08:00
* Prevent certain symbols in database passwords * Update * Update copy * Address feedback * Update copy * Update apps/studio/components/interfaces/ProjectCreation/SpecialSymbolsCallout.tsx Co-authored-by: Jonathan Summers-Muir <MildTomato@users.noreply.github.com> --------- Co-authored-by: Jonathan Summers-Muir <MildTomato@users.noreply.github.com>
11 lines
506 B
TypeScript
11 lines
506 B
TypeScript
import { expect, test } from 'vitest'
|
|
import { SPECIAL_CHARS_REGEX } from './ProjectCreation.constants'
|
|
|
|
test('Regex test to surface if password contains @, : or /', () => {
|
|
expect(!'teststring'.match(SPECIAL_CHARS_REGEX)).toEqual(false)
|
|
expect(!'test@string'.match(SPECIAL_CHARS_REGEX)).toEqual(true)
|
|
expect(!'te:ststring'.match(SPECIAL_CHARS_REGEX)).toEqual(true)
|
|
expect(!`tests/tring`.match(SPECIAL_CHARS_REGEX)).toEqual(true)
|
|
expect(!'!#$%^&*()'.match(SPECIAL_CHARS_REGEX)).toEqual(false)
|
|
})
|