From ae20e682bef99c6799314f93f5711e854429b9c6 Mon Sep 17 00:00:00 2001 From: D051920 Date: Wed, 12 Aug 2020 11:18:21 +0200 Subject: [PATCH] Change list object in tests --- test/cds.ql.test.js | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/test/cds.ql.test.js b/test/cds.ql.test.js index 201fad70..840e3d2f 100644 --- a/test/cds.ql.test.js +++ b/test/cds.ql.test.js @@ -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(