Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update OData tests to follow the documented guidelines #1177 #1268

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions test/odata.test.js
Original file line number Diff line number Diff line change
@@ -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 { 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',
Expand Down Expand Up @@ -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)
Expand Down
Loading