From e0b9a29bbcb2ce8690cb9461ae8d11eb0044a317 Mon Sep 17 00:00:00 2001 From: Daniel Hutzel Date: Fri, 13 Dec 2024 07:09:54 +0100 Subject: [PATCH] .. --- test/cds.ql.test.js | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/test/cds.ql.test.js b/test/cds.ql.test.js index 4ebfe63f..ea60a341 100644 --- a/test/cds.ql.test.js +++ b/test/cds.ql.test.js @@ -672,13 +672,11 @@ describe('cds.ql → cqn', () => { describe(`INSERT...`, () => { test('entries ({a,b}, ...)', () => { const entries = [{ foo: 1 }, { boo: 2 }] - expect(INSERT(...entries).into(Foo)) - .to.eql(INSERT(entries).into(Foo)) - .to.eql(INSERT.into(Foo).entries(...entries)) - .to.eql(INSERT.into(Foo).entries(entries)) - .to.eql({ - INSERT: { into: { ref: ['Foo'] }, entries }, - }) + expect(INSERT(...entries).into(Foo).INSERT) + .to.eql(INSERT(entries).into(Foo).INSERT) + .to.eql(INSERT.into(Foo).entries(...entries).INSERT) + .to.eql(INSERT.into(Foo).entries(entries).INSERT) + .to.eql({ into: { ref: ['Foo'] }, entries }) }) test('rows ([1,2], ...)', () => { @@ -689,8 +687,9 @@ describe('cds.ql → cqn', () => { [1, 2], [3, 4], ]) + .INSERT ) - .to.eql(INSERT.into(Foo).columns('a', 'b').rows([1, 2], [3, 4])) + .to.eql(INSERT.into(Foo).columns('a', 'b').rows([1, 2], [3, 4]).INSERT) .to.eql({ INSERT: { into: { ref: ['Foo'] }, @@ -700,15 +699,15 @@ describe('cds.ql → cqn', () => { [3, 4], ], }, - }) + }.INSERT) }) test('values (1,2)', () => { - expect(INSERT.into(Foo).columns('a', 'b').values([1, 2])) - .to.eql(INSERT.into(Foo).columns('a', 'b').values(1, 2)) + expect(INSERT.into(Foo).columns('a', 'b').values([1, 2]).INSERT) + .to.eql(INSERT.into(Foo).columns('a', 'b').values(1, 2).INSERT) .to.eql({ INSERT: { into: { ref: ['Foo'] }, columns: ['a', 'b'], values: [1, 2] }, - }) + }.INSERT) }) test('w/ plain SQL', () => {