Partially revert "fix: adjusted tests for new OData adapter" (#726)
This commit is contained in:
@@ -8,8 +8,8 @@ describe('cap/samples - Localized Data', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
it('serves localized metadata documents', async () => {
|
it('serves localized $metadata documents', async () => {
|
||||||
const { data } = await GET(`/browse/$metadata?sap-language=de`, { headers: { 'accept-language': 'de', Accept: 'application/xml' }})
|
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"/>')
|
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 () => {
|
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' },
|
headers: { 'Accept-Language': 'de' },
|
||||||
})
|
})
|
||||||
expect(data.value).to.containSubset([
|
expect(data.value).to.containSubset([
|
||||||
@@ -69,7 +69,7 @@ describe('cap/samples - Localized Data', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('supports @cds.localized:false', async ()=>{
|
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' },
|
headers: { 'Accept-Language': 'de' },
|
||||||
})
|
})
|
||||||
expect(data.value).to.containSubset([
|
expect(data.value).to.containSubset([
|
||||||
|
|||||||
@@ -5,14 +5,12 @@ describe('cap/samples - Bookshop APIs', () => {
|
|||||||
axios.defaults.auth = { username: 'alice', password: 'admin' }
|
axios.defaults.auth = { username: 'alice', password: 'admin' }
|
||||||
|
|
||||||
it('serves $metadata documents in v4', async () => {
|
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)
|
expect(status).to.equal(200)
|
||||||
|
expect(headers).to.contain({
|
||||||
// TODO
|
// 'content-type': 'application/xml', //> fails with 'application/xml;charset=utf-8'
|
||||||
/*expect(headers).to.contain({
|
|
||||||
'odata-version': '4.0',
|
'odata-version': '4.0',
|
||||||
})*/
|
})
|
||||||
|
|
||||||
expect(headers['content-type']).to.match(/application\/xml/)
|
expect(headers['content-type']).to.match(/application\/xml/)
|
||||||
expect(data).to.contain('<EntitySet Name="Books" EntityType="CatalogService.Books">')
|
expect(data).to.contain('<EntitySet Name="Books" EntityType="CatalogService.Books">')
|
||||||
expect(data).to.contain('<Annotation Term="Common.Label" String="Currency"/>')
|
expect(data).to.contain('<Annotation Term="Common.Label" String="Currency"/>')
|
||||||
|
|||||||
Reference in New Issue
Block a user