From fead1f436a5f30c4c28974d2b282866bbf0be70f Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 20 Jun 2024 18:53:01 +0100 Subject: [PATCH] test case is only for internal. --- .../server/src/api/routes/tests/table.spec.ts | 50 ++++++++++--------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/packages/server/src/api/routes/tests/table.spec.ts b/packages/server/src/api/routes/tests/table.spec.ts index 4c3d8db1af..a84fd923bb 100644 --- a/packages/server/src/api/routes/tests/table.spec.ts +++ b/packages/server/src/api/routes/tests/table.spec.ts @@ -276,30 +276,34 @@ describe.each([ }) }) - it("shouldn't allow duplicate column names", async () => { - const saveTableRequest: SaveTableRequest = { - ...basicTable(), - } - saveTableRequest.schema["Type"] = { type: FieldType.STRING, name: "Type" } - await config.api.table.save(saveTableRequest, { - status: 400, - body: { - message: - 'Column "type" is duplicated - make sure there are no duplicate columns names, this is case insensitive.', - }, + isInternal && + it("shouldn't allow duplicate column names", async () => { + const saveTableRequest: SaveTableRequest = { + ...basicTable(), + } + saveTableRequest.schema["Type"] = { + type: FieldType.STRING, + name: "Type", + } + await config.api.table.save(saveTableRequest, { + status: 400, + body: { + message: + 'Column "type" is duplicated - make sure there are no duplicate columns names, this is case insensitive.', + }, + }) + saveTableRequest.schema = { + foo: { type: FieldType.STRING, name: "foo" }, + FOO: { type: FieldType.STRING, name: "FOO" }, + } + await config.api.table.save(saveTableRequest, { + status: 400, + body: { + message: + 'Column "foo" is duplicated - make sure there are no duplicate columns names, this is case insensitive.', + }, + }) }) - saveTableRequest.schema = { - foo: { type: FieldType.STRING, name: "foo" }, - FOO: { type: FieldType.STRING, name: "FOO" }, - } - await config.api.table.save(saveTableRequest, { - status: 400, - body: { - message: - 'Column "foo" is duplicated - make sure there are no duplicate columns names, this is case insensitive.', - }, - }) - }) it("should add a new column for an internal DB table", async () => { const saveTableRequest: SaveTableRequest = {