Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

466 B
Raw Blame
import { describe, expect, test } from 'vitest'

import { formatRecoveryCode } from './RecoveryCodesModal.utils'

describe('formatRecoveryCode', () => {
  test('transforms a backend code to a human readable format', () => {
    expect(formatRecoveryCode('p6pcl32vl6q6l6nt')).toEqual('P6PC-L32V-L6Q6-L6NT')
  })
  test('returns the code unchanged if it does not match the expected format', () => {
    expect(formatRecoveryCode('bazinga')).toEqual('bazinga')
  })
})