diff --git a/packages/backend-core/src/utils/tests/utils.spec.ts b/packages/backend-core/src/utils/tests/utils.spec.ts index b3e9cda353..64594302f2 100644 --- a/packages/backend-core/src/utils/tests/utils.spec.ts +++ b/packages/backend-core/src/utils/tests/utils.spec.ts @@ -14,7 +14,7 @@ describe("utils", () => { }) it("should call platform logout", async () => { - await doInTenant(structures.tenant.name(), async () => { + await doInTenant(structures.tenant.id(), async () => { const ctx = structures.koa.newContext() await utils.platformLogout({ ctx, userId: "test" }) expect(events.auth.logout).toBeCalledTimes(1) diff --git a/packages/backend-core/tests/utilities/structures/tenants.ts b/packages/backend-core/tests/utilities/structures/tenants.ts index 8d593f176b..b23bc8be75 100644 --- a/packages/backend-core/tests/utilities/structures/tenants.ts +++ b/packages/backend-core/tests/utilities/structures/tenants.ts @@ -1,5 +1,5 @@ import { newid } from "../../../src/newid" -export function name() { +export function id() { return `tenant-${newid()}` } diff --git a/packages/server/src/tests/utilities/TestConfiguration.ts b/packages/server/src/tests/utilities/TestConfiguration.ts index 54f90d121f..9406f3f049 100644 --- a/packages/server/src/tests/utilities/TestConfiguration.ts +++ b/packages/server/src/tests/utilities/TestConfiguration.ts @@ -149,7 +149,7 @@ class TestConfiguration { async init(appName = newid()) { this.defaultUserValues = this.populateDefaultUserValues() if (context.isMultiTenant()) { - this.tenantId = structures.tenant.name() + this.tenantId = structures.tenant.id() } if (!this.started) { diff --git a/packages/worker/src/tests/TestConfiguration.ts b/packages/worker/src/tests/TestConfiguration.ts index b7444293df..0cc1e61e65 100644 --- a/packages/worker/src/tests/TestConfiguration.ts +++ b/packages/worker/src/tests/TestConfiguration.ts @@ -135,7 +135,7 @@ class TestConfiguration { async beforeAll() { try { - this.#tenantId = structures.tenant.name() + this.#tenantId = structures.tenant.id() // Running tests in parallel causes issues creating the globaldb twice. This ensures the db is properly created before starting await retry(async () => await this.createDefaultUser()) diff --git a/packages/worker/src/tests/api/users.ts b/packages/worker/src/tests/api/users.ts index e9ccb9331d..16a43d70e0 100644 --- a/packages/worker/src/tests/api/users.ts +++ b/packages/worker/src/tests/api/users.ts @@ -100,7 +100,7 @@ export class UserAPI extends TestAPI { request = { email: structures.email(), password: generator.string(), - tenantId: structures.tenant.name(), + tenantId: structures.tenant.id(), } } const res = await this.request