prepare samples for removal of quirks mode (#689)
This commit is contained in:
@@ -676,7 +676,7 @@ describe('cds.ql → cqn', () => {
|
|||||||
.to.eql(INSERT.into(Foo).entries(...entries))
|
.to.eql(INSERT.into(Foo).entries(...entries))
|
||||||
.to.eql(INSERT.into(Foo).entries(entries))
|
.to.eql(INSERT.into(Foo).entries(entries))
|
||||||
.to.eql({
|
.to.eql({
|
||||||
INSERT: { into: 'Foo', entries },
|
INSERT: { into: cds.env.ql.quirks_mode ? 'Foo' : { ref: ['Foo'] }, entries },
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -692,7 +692,7 @@ describe('cds.ql → cqn', () => {
|
|||||||
.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]))
|
||||||
.to.eql({
|
.to.eql({
|
||||||
INSERT: {
|
INSERT: {
|
||||||
into: 'Foo',
|
into: cds.env.ql.quirks_mode ? 'Foo' : { ref: ['Foo'] },
|
||||||
columns: ['a', 'b'],
|
columns: ['a', 'b'],
|
||||||
rows: [
|
rows: [
|
||||||
[1, 2],
|
[1, 2],
|
||||||
@@ -706,7 +706,7 @@ describe('cds.ql → cqn', () => {
|
|||||||
expect(INSERT.into(Foo).columns('a', 'b').values([1, 2]))
|
expect(INSERT.into(Foo).columns('a', 'b').values([1, 2]))
|
||||||
.to.eql(INSERT.into(Foo).columns('a', 'b').values(1, 2))
|
.to.eql(INSERT.into(Foo).columns('a', 'b').values(1, 2))
|
||||||
.to.eql({
|
.to.eql({
|
||||||
INSERT: { into: 'Foo', columns: ['a', 'b'], values: [1, 2] },
|
INSERT: { into: cds.env.ql.quirks_mode ? 'Foo' : { ref: ['Foo'] }, columns: ['a', 'b'], values: [1, 2] },
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -721,7 +721,7 @@ describe('cds.ql → cqn', () => {
|
|||||||
test('entity (..., <key>)', () => {
|
test('entity (..., <key>)', () => {
|
||||||
const cqnWhere = {
|
const cqnWhere = {
|
||||||
UPDATE: {
|
UPDATE: {
|
||||||
entity: 'capire.bookshop.Books',
|
entity: cds.env.ql.quirks_mode ? 'capire.bookshop.Books' : { ref: ['capire.bookshop.Books'] },
|
||||||
where: [{ ref: ['ID'] }, '=', { val: 4711 }],
|
where: [{ ref: ['ID'] }, '=', { val: 4711 }],
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -765,7 +765,7 @@ describe('cds.ql → cqn', () => {
|
|||||||
.to.eql(UPDATE(Foo).with({ foo: 11, bar: { '-=': 22 } }))
|
.to.eql(UPDATE(Foo).with({ foo: 11, bar: { '-=': 22 } }))
|
||||||
.to.eql({
|
.to.eql({
|
||||||
UPDATE: {
|
UPDATE: {
|
||||||
entity: 'Foo',
|
entity: cds.env.ql.quirks_mode ? 'Foo' : { ref: ['Foo'] },
|
||||||
data: { foo: 11 },
|
data: { foo: 11 },
|
||||||
with: {
|
with: {
|
||||||
bar: { xpr: [{ ref: ['bar'] }, '-', { val: 22 }] },
|
bar: { xpr: [{ ref: ['bar'] }, '-', { val: 22 }] },
|
||||||
@@ -776,7 +776,7 @@ describe('cds.ql → cqn', () => {
|
|||||||
// some more
|
// some more
|
||||||
expect(UPDATE(Foo).with(`bar = coalesce(x,y), car = 'foo''s bar, car'`)).to.eql({
|
expect(UPDATE(Foo).with(`bar = coalesce(x,y), car = 'foo''s bar, car'`)).to.eql({
|
||||||
UPDATE: {
|
UPDATE: {
|
||||||
entity: 'Foo',
|
entity: cds.env.ql.quirks_mode ? 'Foo' : { ref: ['Foo'] },
|
||||||
data: {
|
data: {
|
||||||
car: "foo's bar, car",
|
car: "foo's bar, car",
|
||||||
},
|
},
|
||||||
@@ -796,7 +796,7 @@ describe('cds.ql → cqn', () => {
|
|||||||
test('from (..., <key>)', () => {
|
test('from (..., <key>)', () => {
|
||||||
const cqnWhere = {
|
const cqnWhere = {
|
||||||
DELETE: {
|
DELETE: {
|
||||||
from: 'capire.bookshop.Books',
|
from: cds.env.ql.quirks_mode ? 'capire.bookshop.Books' : { ref: ['capire.bookshop.Books'] },
|
||||||
where: [{ ref: ['ID'] }, '=', { val: 4711 }],
|
where: [{ ref: ['ID'] }, '=', { val: 4711 }],
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user