From cb53d31833f4715a950748ed78cfe8ff25736b65 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 26 Jan 2024 10:56:38 +0100 Subject: [PATCH] Renames --- packages/server/src/api/routes/tests/row.spec.ts | 4 ++-- packages/server/src/api/routes/tests/table.spec.ts | 10 +++++----- .../server/src/automations/tests/updateRow.spec.ts | 4 ++-- packages/server/src/sdk/tests/tables.spec.ts | 2 +- packages/server/src/tests/utilities/api/table.ts | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/server/src/api/routes/tests/row.spec.ts b/packages/server/src/api/routes/tests/row.spec.ts index 5b39652976..f13d645be3 100644 --- a/packages/server/src/api/routes/tests/row.spec.ts +++ b/packages/server/src/api/routes/tests/row.spec.ts @@ -581,7 +581,7 @@ describe.each([ tableId: InternalTable.USER_METADATA, } - let table = await config.api.table.create({ + let table = await config.api.table.save({ name: "TestTable", type: "table", sourceType: TableSourceType.INTERNAL, @@ -1690,7 +1690,7 @@ describe.each([ tableConfig.sourceType = TableSourceType.EXTERNAL } } - const table = await config.api.table.create({ + const table = await config.api.table.save({ ...tableConfig, schema: { ...tableConfig.schema, diff --git a/packages/server/src/api/routes/tests/table.spec.ts b/packages/server/src/api/routes/tests/table.spec.ts index 4743bca814..704b30a7ed 100644 --- a/packages/server/src/api/routes/tests/table.spec.ts +++ b/packages/server/src/api/routes/tests/table.spec.ts @@ -438,7 +438,7 @@ describe("/tables", () => { }) it("should successfully migrate a one-to-many user relationship to a user column", async () => { - const table = await config.api.table.create({ + const table = await config.api.table.save({ name: "table", type: "table", sourceId: INTERNAL_TABLE_SOURCE_ID, @@ -496,7 +496,7 @@ describe("/tables", () => { // We found a bug just after releasing this feature where if the row was created from the // users table, not the table linking to it, the migration would succeed but lose the data. // This happened because the order of the documents in the link was reversed. - const table = await config.api.table.create({ + const table = await config.api.table.save({ name: "table", type: "table", sourceId: INTERNAL_TABLE_SOURCE_ID, @@ -554,7 +554,7 @@ describe("/tables", () => { }) it("should successfully migrate a many-to-many user relationship to a users column", async () => { - const table = await config.api.table.create({ + const table = await config.api.table.save({ name: "table", type: "table", sourceId: INTERNAL_TABLE_SOURCE_ID, @@ -611,7 +611,7 @@ describe("/tables", () => { }) it("should successfully migrate a many-to-one user relationship to a users column", async () => { - const table = await config.api.table.create({ + const table = await config.api.table.save({ name: "table", type: "table", sourceId: INTERNAL_TABLE_SOURCE_ID, @@ -670,7 +670,7 @@ describe("/tables", () => { describe("unhappy paths", () => { let table: Table beforeAll(async () => { - table = await config.api.table.create({ + table = await config.api.table.save({ name: "table", type: "table", sourceId: INTERNAL_TABLE_SOURCE_ID, diff --git a/packages/server/src/automations/tests/updateRow.spec.ts b/packages/server/src/automations/tests/updateRow.spec.ts index 7e369f1ecb..b64c52147d 100644 --- a/packages/server/src/automations/tests/updateRow.spec.ts +++ b/packages/server/src/automations/tests/updateRow.spec.ts @@ -67,7 +67,7 @@ describe("test the update row action", () => { tableId: InternalTable.USER_METADATA, } - let table = await config.api.table.create({ + let table = await config.api.table.save({ name: uuid.v4(), type: "table", sourceType: TableSourceType.INTERNAL, @@ -120,7 +120,7 @@ describe("test the update row action", () => { tableId: InternalTable.USER_METADATA, } - let table = await config.api.table.create({ + let table = await config.api.table.save({ name: uuid.v4(), type: "table", sourceType: TableSourceType.INTERNAL, diff --git a/packages/server/src/sdk/tests/tables.spec.ts b/packages/server/src/sdk/tests/tables.spec.ts index 0e3cd73cfd..00099b0df6 100644 --- a/packages/server/src/sdk/tests/tables.spec.ts +++ b/packages/server/src/sdk/tests/tables.spec.ts @@ -9,7 +9,7 @@ describe("tables", () => { beforeAll(async () => { await config.init() - table = await config.api.table.create(basicTable()) + table = await config.api.table.save(basicTable()) }) describe("getTables", () => { diff --git a/packages/server/src/tests/utilities/api/table.ts b/packages/server/src/tests/utilities/api/table.ts index ffd9e19ee8..5a9654e3bc 100644 --- a/packages/server/src/tests/utilities/api/table.ts +++ b/packages/server/src/tests/utilities/api/table.ts @@ -13,7 +13,7 @@ export class TableAPI extends TestAPI { super(config) } - create = async ( + save = async ( data: SaveTableRequest, { expectStatus } = { expectStatus: 200 } ): Promise => {