diff --git a/test/cds.ql.test.js b/test/cds.ql.test.js index e38d3b39..b6d23c6e 100644 --- a/test/cds.ql.test.js +++ b/test/cds.ql.test.js @@ -13,9 +13,10 @@ describe('cds.ql → cqn', () => { // let cqn - describe.skip(`BUGS + GAPS...`, () => { + describe(`SELECT...`, () => { it('should consistently handle *', () => { + if (!cdr) return expect({ SELECT: { from: { ref: ['Foo'] }, columns: ['*'] }, }) @@ -25,19 +26,6 @@ describe('cds.ql → cqn', () => { .to.eql(SELECT.from(Foo,['*'])) }) - - it('should consistently handle lists', () => { - const ID = 11, args = [`foo`, "'bar'", 3] - const cqn = CQL`SELECT from Foo where ID=11 and x in (foo,'bar',3)` - 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(SELECT.from(Foo).where({ ID, x:args })).to.eql(cqn) - }) - - }) - - - describe(`SELECT...`, () => { test('from ( Foo )', () => { expect({ SELECT: { from: { ref: ['Foo'] } }, @@ -390,6 +378,15 @@ describe('cds.ql → cqn', () => { ) }) + it('should consistently handle lists', () => { + if (!cdr) return + const ID = 11, args = [{ref:['foo']}, "bar", 3] + const cqn = CQL`SELECT from Foo where ID=11 and x in (foo,'bar',3)` + 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(SELECT.from(Foo).where({ ID, x:args })).to.eql(cqn) + }) + test('w/ sub selects', () => { // in where causes expect(SELECT.from(Foo).where({ x: SELECT('y').from('Bar') })).to.eql(