1
0
Fork 0
mirror of synced 2024-05-17 02:42:53 +12:00
budibase/qa-core/src/account-api/tests/accounts/accounts.cloud.internal.spec.ts
2023-07-31 16:09:45 +02:00

33 lines
884 B
TypeScript

import TestConfiguration from "../../config/TestConfiguration"
import * as fixtures from "../../fixtures"
import { generator } from "../../../shared"
import { Hosting } from "@budibase/types"
describe("Account Internal Operations", () => {
const config = new TestConfiguration()
beforeAll(async () => {
await config.beforeAll()
})
afterAll(async () => {
await config.afterAll()
})
it("performs account deletion by ID", async () => {
// Deleting by unknown id doesn't work
const accountId = generator.guid()
await config.api.accounts.delete(accountId, { status: 404 })
// Create new account
const [_, account] = await config.api.accounts.create({
...fixtures.accounts.generateAccount({
hosting: Hosting.CLOUD,
}),
})
// New account can be deleted
await config.api.accounts.delete(account.accountId)
})
})