Change list object in tests

This commit is contained in:
D051920
2020-08-12 11:18:21 +02:00
parent 53527aac50
commit ae20e682be

View File

@@ -335,11 +335,31 @@ describe('cds.ql → cqn', () => {
{ val: 'bar' },
',',
{ 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(