1
0
Fork 0
mirror of synced 2024-06-12 23:44:39 +12:00
budibase/qa-core/src/account-api/fixtures/accounts.ts

25 lines
583 B
TypeScript
Raw Normal View History

2023-07-13 23:36:50 +12:00
import { generator } from "../../shared"
import { Hosting, CreateAccountRequest } from "@budibase/types"
// TODO: Refactor me to central location
2023-07-25 22:28:14 +12:00
export const generateAccount = (
partial: Partial<CreateAccountRequest>
): CreateAccountRequest => {
const uuid = generator.guid()
2023-07-13 23:36:50 +12:00
2023-07-20 02:42:12 +12:00
const email = `${uuid}@budibase.com`
const tenant = `tenant${uuid.replace(/-/g, "")}`
2023-07-13 23:36:50 +12:00
2023-07-25 22:28:14 +12:00
return {
email,
hosting: Hosting.CLOUD,
name: email,
password: uuid,
profession: "software_engineer",
size: "10+",
tenantId: tenant,
tenantName: tenant,
...partial,
}
2023-07-13 23:36:50 +12:00
}