Rename name for id

This commit is contained in:
adrinr 2023-02-03 12:09:56 +00:00
parent 7605bb46f6
commit c747cabe73
5 changed files with 5 additions and 5 deletions

View File

@ -14,7 +14,7 @@ describe("utils", () => {
}) })
it("should call platform logout", async () => { it("should call platform logout", async () => {
await doInTenant(structures.tenant.name(), async () => { await doInTenant(structures.tenant.id(), async () => {
const ctx = structures.koa.newContext() const ctx = structures.koa.newContext()
await utils.platformLogout({ ctx, userId: "test" }) await utils.platformLogout({ ctx, userId: "test" })
expect(events.auth.logout).toBeCalledTimes(1) expect(events.auth.logout).toBeCalledTimes(1)

View File

@ -1,5 +1,5 @@
import { newid } from "../../../src/newid" import { newid } from "../../../src/newid"
export function name() { export function id() {
return `tenant-${newid()}` return `tenant-${newid()}`
} }

View File

@ -149,7 +149,7 @@ class TestConfiguration {
async init(appName = newid()) { async init(appName = newid()) {
this.defaultUserValues = this.populateDefaultUserValues() this.defaultUserValues = this.populateDefaultUserValues()
if (context.isMultiTenant()) { if (context.isMultiTenant()) {
this.tenantId = structures.tenant.name() this.tenantId = structures.tenant.id()
} }
if (!this.started) { if (!this.started) {

View File

@ -135,7 +135,7 @@ class TestConfiguration {
async beforeAll() { async beforeAll() {
try { 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 // 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()) await retry(async () => await this.createDefaultUser())

View File

@ -100,7 +100,7 @@ export class UserAPI extends TestAPI {
request = { request = {
email: structures.email(), email: structures.email(),
password: generator.string(), password: generator.string(),
tenantId: structures.tenant.name(), tenantId: structures.tenant.id(),
} }
} }
const res = await this.request const res = await this.request