From 67fcee2956b94143c441eab6be704e4b63905b8b Mon Sep 17 00:00:00 2001 From: Mahati Shankar <93712176+smahati@users.noreply.github.com> Date: Tue, 5 Nov 2024 17:54:15 +0100 Subject: [PATCH 1/2] Update odata.test.js --- test/odata.test.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/test/odata.test.js b/test/odata.test.js index f1c7562c..6c7dc2e6 100644 --- a/test/odata.test.js +++ b/test/odata.test.js @@ -1,12 +1,11 @@ const cds = require('@sap/cds/lib') -const { GET, POST, PATCH, axios, expect } = cds.test(__dirname+'/..') -const EDIT = (url) => POST (url+'/TravelService.draftEdit',{}) -const SAVE = (url) => POST (url+'/TravelService.draftActivate') -axios.defaults.headers['content-type'] = 'application/json;IEEE754Compatible=true' // REVISIT: can be removed when @sap/cds 5.1.5 is released? -axios.defaults.auth = { username: 'alice', password: 'admin' } - describe ("Basic Querying", () => { + const { GET, POST, PATCH, axios, expect } = cds.test(__dirname+'/..') + axios.defaults.headers['content-type'] = 'application/json;IEEE754Compatible=true' // REVISIT: can be removed when @sap/cds 5.1.5 is released? + axios.defaults.auth = { username: 'alice', password: 'admin' } + + it ("should read from row references", async()=>{ const TravelRef = {ref:[{ id:'TravelService.Travel', @@ -42,6 +41,11 @@ describe ("Basic Querying", () => { describe('Basic OData', () => { + const { GET, POST, PATCH, axios, expect } = cds.test(__dirname+'/..') + axios.defaults.headers['content-type'] = 'application/json;IEEE754Compatible=true' // REVISIT: can be removed when @sap/cds 5.1.5 is released? + axios.defaults.auth = { username: 'alice', password: 'admin' } + const EDIT = (url) => POST (url+'/TravelService.draftEdit',{}) + const SAVE = (url) => POST (url+'/TravelService.draftActivate') it('serves $metadata documents in v4', async () => { const { headers, status, data } = await GET `/processor/$metadata` expect(status).to.equal(200) From f1e26dce3add970e51fd2ae2800eeb5d7a32298b Mon Sep 17 00:00:00 2001 From: Mahati Shankar <93712176+smahati@users.noreply.github.com> Date: Tue, 5 Nov 2024 17:59:17 +0100 Subject: [PATCH 2/2] Update odata.test.js --- test/odata.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/odata.test.js b/test/odata.test.js index 6c7dc2e6..ecbacacf 100644 --- a/test/odata.test.js +++ b/test/odata.test.js @@ -1,7 +1,7 @@ const cds = require('@sap/cds/lib') describe ("Basic Querying", () => { - const { GET, POST, PATCH, axios, expect } = cds.test(__dirname+'/..') + const { axios, expect } = cds.test(__dirname+'/..') axios.defaults.headers['content-type'] = 'application/json;IEEE754Compatible=true' // REVISIT: can be removed when @sap/cds 5.1.5 is released? axios.defaults.auth = { username: 'alice', password: 'admin' }