Partially revert "fix: adjusted tests for new OData adapter" (#726)

This commit is contained in:
Samuel Brucksch
2024-05-28 18:22:45 +02:00
committed by GitHub
parent ac3cfa81c7
commit a191c4fd50
2 changed files with 8 additions and 10 deletions

View File

@@ -8,8 +8,8 @@ describe('cap/samples - Localized Data', () => {
})
it('serves localized metadata documents', async () => {
const { data } = await GET(`/browse/$metadata?sap-language=de`, { headers: { 'accept-language': 'de', Accept: 'application/xml' }})
it('serves localized $metadata documents', async () => {
const { data } = await GET(`/browse/$metadata?sap-language=de`, { headers: { 'accept-language': 'de', accept: 'application/xml' }})
expect(data).to.contain('<Annotation Term="Common.Label" String="Währung"/>')
})
@@ -27,7 +27,7 @@ describe('cap/samples - Localized Data', () => {
})
it('supports queries with $expand', async () => {
const { data } = await GET(`/browse/Books?$select=title,author&$expand=currency`, {
const { data } = await GET(`/browse/Books?&$select=title,author&$expand=currency`, {
headers: { 'Accept-Language': 'de' },
})
expect(data.value).to.containSubset([
@@ -69,7 +69,7 @@ describe('cap/samples - Localized Data', () => {
})
it('supports @cds.localized:false', async ()=>{
const { data } = await GET(`/browse/BooksSans?$select=title,localized_title&$expand=currency&$filter=locale eq 'de' or locale eq null`, {
const { data } = await GET(`/browse/BooksSans?&$select=title,localized_title&$expand=currency&$filter=locale eq 'de' or locale eq null`, {
headers: { 'Accept-Language': 'de' },
})
expect(data.value).to.containSubset([

View File

@@ -5,14 +5,12 @@ describe('cap/samples - Bookshop APIs', () => {
axios.defaults.auth = { username: 'alice', password: 'admin' }
it('serves $metadata documents in v4', async () => {
const { headers, status, data } = await GET(`/browse/$metadata`, { headers: { Accept: 'application/xml' } })
const { headers, status, data } = await GET(`/browse/$metadata`, { headers: { accept: 'application/xml' } })
expect(status).to.equal(200)
// TODO
/*expect(headers).to.contain({
expect(headers).to.contain({
// 'content-type': 'application/xml', //> fails with 'application/xml;charset=utf-8'
'odata-version': '4.0',
})*/
})
expect(headers['content-type']).to.match(/application\/xml/)
expect(data).to.contain('<EntitySet Name="Books" EntityType="CatalogService.Books">')
expect(data).to.contain('<Annotation Term="Common.Label" String="Currency"/>')