Compare commits
5 Commits
pdf
...
enable-fix
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ae20e682be | ||
|
|
53527aac50 | ||
|
|
04f9f2a06f | ||
|
|
fff62e68f1 | ||
|
|
ade170367b |
@@ -261,7 +261,7 @@ describe('cds.ql → cqn', () => {
|
|||||||
// same for works distinct
|
// same for works distinct
|
||||||
})
|
})
|
||||||
|
|
||||||
test.skip('where ( ... cql | {x:y} )', () => {
|
test('where ( ... cql | {x:y} )', () => {
|
||||||
const args = [`foo`, "'bar'", 3]
|
const args = [`foo`, "'bar'", 3]
|
||||||
const ID = 11
|
const ID = 11
|
||||||
|
|
||||||
@@ -278,7 +278,6 @@ describe('cds.ql → cqn', () => {
|
|||||||
from: { ref: ['Foo'] },
|
from: { ref: ['Foo'] },
|
||||||
where: cdr
|
where: cdr
|
||||||
? [
|
? [
|
||||||
// '(', //> this one is not required
|
|
||||||
{ ref: ['ID'] },
|
{ ref: ['ID'] },
|
||||||
'=',
|
'=',
|
||||||
{ val: ID },
|
{ val: ID },
|
||||||
@@ -287,7 +286,7 @@ describe('cds.ql → cqn', () => {
|
|||||||
'in',
|
'in',
|
||||||
{ val: args },
|
{ val: args },
|
||||||
'and',
|
'and',
|
||||||
'(', //> this one is missing, and that's changing the logic -> that's a BUG
|
'(',
|
||||||
{ ref: ['x'] },
|
{ ref: ['x'] },
|
||||||
'like',
|
'like',
|
||||||
{ val: '%x%' },
|
{ val: '%x%' },
|
||||||
@@ -298,7 +297,6 @@ describe('cds.ql → cqn', () => {
|
|||||||
')',
|
')',
|
||||||
]
|
]
|
||||||
: [
|
: [
|
||||||
'(', //> this one is not required
|
|
||||||
{ ref: ['ID'] },
|
{ ref: ['ID'] },
|
||||||
'=',
|
'=',
|
||||||
{ val: ID },
|
{ val: ID },
|
||||||
@@ -307,7 +305,7 @@ describe('cds.ql → cqn', () => {
|
|||||||
'in',
|
'in',
|
||||||
{ val: args },
|
{ val: args },
|
||||||
'and',
|
'and',
|
||||||
// '(', //> this one is missing, and that's changing the logic -> that's a BUG
|
'(',
|
||||||
{ ref: ['x'] },
|
{ ref: ['x'] },
|
||||||
'like',
|
'like',
|
||||||
{ val: '%x%' },
|
{ val: '%x%' },
|
||||||
@@ -337,11 +335,31 @@ describe('cds.ql → cqn', () => {
|
|||||||
{ val: 'bar' },
|
{ val: 'bar' },
|
||||||
',',
|
',',
|
||||||
{ val: 3 },
|
{ val: 3 },
|
||||||
')',
|
')'
|
||||||
],
|
]
|
||||||
},
|
}
|
||||||
})
|
})
|
||||||
expect(SELECT.from(Foo).where(`ID=`, ID, `and x in`, args)).to.eql(cqn)
|
|
||||||
|
const cqnFluent = {
|
||||||
|
SELECT: {
|
||||||
|
from: { ref: ['Foo'] },
|
||||||
|
where: [
|
||||||
|
{ ref: ['ID'] },
|
||||||
|
'=',
|
||||||
|
{ val: ID },
|
||||||
|
'and',
|
||||||
|
{ ref: ['x'] },
|
||||||
|
'in',
|
||||||
|
{ list: [
|
||||||
|
{ val: 'foo' },
|
||||||
|
{ val: 'bar' },
|
||||||
|
{ val: 3 }
|
||||||
|
] }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
expect(SELECT.from(Foo).where(`ID=`, ID, `and x in`, args)).to.eql(cqnFluent)
|
||||||
expect(SELECT.from(Foo).where(`ID=${ID} and x in (${args})`)).to.eql(cqn)
|
expect(SELECT.from(Foo).where(`ID=${ID} and x in (${args})`)).to.eql(cqn)
|
||||||
|
|
||||||
expect(
|
expect(
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ describe('Localized Data', () => {
|
|||||||
])
|
])
|
||||||
})
|
})
|
||||||
|
|
||||||
xit('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' },
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user