From b6bdd04ea82445f3e93bf420ccd9430bf2bd4eee Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Tue, 2 Feb 2021 13:14:32 +0000 Subject: [PATCH] Fixing test failure due to not deleting the ID attached to table in couchTest Utils. --- packages/server/src/api/routes/tests/couchTestUtils.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/server/src/api/routes/tests/couchTestUtils.js b/packages/server/src/api/routes/tests/couchTestUtils.js index 9f02047b4b..59a9b6a7c2 100644 --- a/packages/server/src/api/routes/tests/couchTestUtils.js +++ b/packages/server/src/api/routes/tests/couchTestUtils.js @@ -57,7 +57,10 @@ exports.BASE_TABLE = { }, } -exports.createTable = async (request, appId, table) => { +exports.createTable = async (request, appId, table, removeId = true) => { + if (removeId && table != null && table._id) { + delete table._id + } table = table || exports.BASE_TABLE const res = await request @@ -75,7 +78,7 @@ exports.createLinkedTable = async (request, appId) => { fieldName: "link", tableId: table._id, } - return exports.createTable(request, appId, table) + return exports.createTable(request, appId, table, false) } exports.createAttachmentTable = async (request, appId) => { @@ -83,7 +86,7 @@ exports.createAttachmentTable = async (request, appId) => { table.schema.attachment = { type: "attachment", } - return exports.createTable(request, appId, table) + return exports.createTable(request, appId, table, false) } exports.getAllFromTable = async (request, appId, tableId) => {