ProjectCreation.test.ts 531 B

1234567891011
  1. import { expect, test } from 'vitest'
  2. import { DATABASE_PASSWORD_REGEX } from './ProjectCreation.constants'
  3. test('Regex test to surface if password contains @, : or /', () => {
  4. expect(!'teststring'.match(DATABASE_PASSWORD_REGEX)).toEqual(false)
  5. expect(!'test@string'.match(DATABASE_PASSWORD_REGEX)).toEqual(true)
  6. expect(!'te:ststring'.match(DATABASE_PASSWORD_REGEX)).toEqual(true)
  7. expect(!`tests/tring`.match(DATABASE_PASSWORD_REGEX)).toEqual(true)
  8. expect(!'!#$%^&*()'.match(DATABASE_PASSWORD_REGEX)).toEqual(false)
  9. })