..
This commit is contained in:
@@ -672,13 +672,11 @@ describe('cds.ql → cqn', () => {
|
|||||||
describe(`INSERT...`, () => {
|
describe(`INSERT...`, () => {
|
||||||
test('entries ({a,b}, ...)', () => {
|
test('entries ({a,b}, ...)', () => {
|
||||||
const entries = [{ foo: 1 }, { boo: 2 }]
|
const entries = [{ foo: 1 }, { boo: 2 }]
|
||||||
expect(INSERT(...entries).into(Foo))
|
expect(INSERT(...entries).into(Foo).INSERT)
|
||||||
.to.eql(INSERT(entries).into(Foo))
|
.to.eql(INSERT(entries).into(Foo).INSERT)
|
||||||
.to.eql(INSERT.into(Foo).entries(...entries))
|
.to.eql(INSERT.into(Foo).entries(...entries).INSERT)
|
||||||
.to.eql(INSERT.into(Foo).entries(entries))
|
.to.eql(INSERT.into(Foo).entries(entries).INSERT)
|
||||||
.to.eql({
|
.to.eql({ into: { ref: ['Foo'] }, entries })
|
||||||
INSERT: { into: { ref: ['Foo'] }, entries },
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
test('rows ([1,2], ...)', () => {
|
test('rows ([1,2], ...)', () => {
|
||||||
@@ -689,8 +687,9 @@ describe('cds.ql → cqn', () => {
|
|||||||
[1, 2],
|
[1, 2],
|
||||||
[3, 4],
|
[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({
|
.to.eql({
|
||||||
INSERT: {
|
INSERT: {
|
||||||
into: { ref: ['Foo'] },
|
into: { ref: ['Foo'] },
|
||||||
@@ -700,15 +699,15 @@ describe('cds.ql → cqn', () => {
|
|||||||
[3, 4],
|
[3, 4],
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
})
|
}.INSERT)
|
||||||
})
|
})
|
||||||
|
|
||||||
test('values (1,2)', () => {
|
test('values (1,2)', () => {
|
||||||
expect(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))
|
.to.eql(INSERT.into(Foo).columns('a', 'b').values(1, 2).INSERT)
|
||||||
.to.eql({
|
.to.eql({
|
||||||
INSERT: { into: { ref: ['Foo'] }, columns: ['a', 'b'], values: [1, 2] },
|
INSERT: { into: { ref: ['Foo'] }, columns: ['a', 'b'], values: [1, 2] },
|
||||||
})
|
}.INSERT)
|
||||||
})
|
})
|
||||||
|
|
||||||
test('w/ plain SQL', () => {
|
test('w/ plain SQL', () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user