Skip to content

Commit

Permalink
prepare samples for removal of quirks mode (#689)
Browse files Browse the repository at this point in the history
  • Loading branch information
johannes-vogel authored Feb 26, 2024
1 parent 0fb8dfd commit e23b04f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions test/cds.ql.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
INSERT: { into: cds.env.ql.quirks_mode ? 'Foo' : { ref: ['Foo'] }, entries },
})
})

Expand All @@ -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',
into: cds.env.ql.quirks_mode ? 'Foo' : { ref: ['Foo'] },
columns: ['a', 'b'],
rows: [
[1, 2],
Expand All @@ -706,7 +706,7 @@ describe('cds.ql → cqn', () => {
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] },
INSERT: { into: cds.env.ql.quirks_mode ? 'Foo' : { ref: ['Foo'] }, columns: ['a', 'b'], values: [1, 2] },
})
})

Expand All @@ -721,7 +721,7 @@ describe('cds.ql → cqn', () => {
test('entity (..., <key>)', () => {
const cqnWhere = {
UPDATE: {
entity: 'capire.bookshop.Books',
entity: cds.env.ql.quirks_mode ? 'capire.bookshop.Books' : { ref: ['capire.bookshop.Books'] },
where: [{ ref: ['ID'] }, '=', { val: 4711 }],
},
}
Expand Down Expand Up @@ -765,7 +765,7 @@ describe('cds.ql → cqn', () => {
.to.eql(UPDATE(Foo).with({ foo: 11, bar: { '-=': 22 } }))
.to.eql({
UPDATE: {
entity: 'Foo',
entity: cds.env.ql.quirks_mode ? 'Foo' : { ref: ['Foo'] },
data: { foo: 11 },
with: {
bar: { xpr: [{ ref: ['bar'] }, '-', { val: 22 }] },
Expand All @@ -776,7 +776,7 @@ describe('cds.ql → cqn', () => {
// some more
expect(UPDATE(Foo).with(`bar = coalesce(x,y), car = 'foo''s bar, car'`)).to.eql({
UPDATE: {
entity: 'Foo',
entity: cds.env.ql.quirks_mode ? 'Foo' : { ref: ['Foo'] },
data: {
car: "foo's bar, car",
},
Expand All @@ -796,7 +796,7 @@ describe('cds.ql → cqn', () => {
test('from (..., <key>)', () => {
const cqnWhere = {
DELETE: {
from: 'capire.bookshop.Books',
from: cds.env.ql.quirks_mode ? 'capire.bookshop.Books' : { ref: ['capire.bookshop.Books'] },
where: [{ ref: ['ID'] }, '=', { val: 4711 }],
},
}
Expand Down

0 comments on commit e23b04f

Please sign in to comment.