From 5e0bc59534cb1c410b57f7a64a1032e1d4b9d4d1 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Thu, 4 Jan 2024 13:19:26 +0000 Subject: [PATCH] test: corrections --- .../tests/unit/rest/tests/newDataApis.test.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/nocodb/tests/unit/rest/tests/newDataApis.test.ts b/packages/nocodb/tests/unit/rest/tests/newDataApis.test.ts index e244bccbf3..15f9005df6 100644 --- a/packages/nocodb/tests/unit/rest/tests/newDataApis.test.ts +++ b/packages/nocodb/tests/unit/rest/tests/newDataApis.test.ts @@ -164,10 +164,12 @@ async function ncAxiosPost({ url = `/api/v2/tables/${table.id}/records`, body = {}, status = 200, -}: { url?: string; body?: any; status?: number } = {}) { + query = {}, +}: { url?: string; body?: any; status?: number; query?: any } = {}) { const response = await request(context.app) .post(url) .set('xc-auth', context.token) + .query(query) .send(body); expect(response.status).to.equal(status); return response; @@ -1612,8 +1614,15 @@ function dateBased() { // read record with Id 801 rsp = await ncAxiosGet({ url: `/api/v2/tables/${table.id}/records/801`, + query: { + fields: 'Id,Date,DateTime', + }, + }); + expect(rsp.body).to.deep.equal({ + Id: 801, + Date: records[0].Date, + DateTime: records[0].DateTime, }); - expect(rsp.body).to.deep.equal({ Id: 801, ...records[0] }); /////////////////////////////////////////////////////////////////////////// @@ -1652,6 +1661,7 @@ function dateBased() { query: { limit: 4, offset: 800, + fields: 'Id,Date,DateTime', }, }); expect(rsp.body.list).to.deep.equal(updatedRecords);