← full-stack-fastapi-template  /  frontend/tests/utils/random.ts

1
export const randomEmail = () =>
2
  `test_${Math.random().toString(36).substring(7)}@example.com`
3
4
export const randomTeamName = () =>
5
  `Team ${Math.random().toString(36).substring(7)}`
6
7
export const randomPassword = () => `${Math.random().toString(36).substring(2)}`
8
9
export const slugify = (text: string) =>
10
  text
11
    .toLowerCase()
12
    .replace(/\s+/g, "-")
13
    .replace(/[^\w-]+/g, "")
14
15
export const randomItemTitle = () =>
16
  `Item ${Math.random().toString(36).substring(7)}`
17
18
export const randomItemDescription = () =>
19
  `Description ${Math.random().toString(36).substring(7)}`
20