Skip to content

Commit

Permalink
chore: enable skipped tests (#335)
Browse files Browse the repository at this point in the history
if a virtual column is the only column in a given clause, we strip the clause from the query as the virtual column doesnt materialize.
  • Loading branch information
patricebender authored Nov 9, 2023
1 parent 5184e41 commit a9473d9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions db-service/test/cqn4sql/flattening.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -742,13 +742,13 @@ describe('Flattening', () => {
expect(query).to.deep.eql(CQL`SELECT from bookshop.Books as Books { Books.ID } GROUP BY Books.ID`)
})

// (SMW) new TODO what should happen here?
// - produce empty GROUP BY clause (cannot be tested easily here)?
// - error?
// same for ORDER BY
it.skip('ignores unmanaged associations in GROUP BY clause, even if it is the only GROUP BY column', () => {
it('ignores unmanaged associations in GROUP BY and deletes the clause if it is the only GROUP BY column', () => {
let query = cqn4sql(CQL`SELECT from bookshop.Books { ID } GROUP BY coAuthorUnmanaged`, model)
expect(query).to.deep.eql(CQL`SELECT from bookshop.Books as Books { Books.ID } GROUP BY x`)
expect(JSON.parse(JSON.stringify(query))).to.deep.eql(CQL`SELECT from bookshop.Books as Books { Books.ID }`)
})
it('ignores unmanaged associations in ORDER BY and deletes the clause if it is the only ORDER BY column', () => {
let query = cqn4sql(CQL`SELECT from bookshop.Books { ID } ORDER BY coAuthorUnmanaged`, model)
expect(JSON.parse(JSON.stringify(query))).to.deep.eql(CQL`SELECT from bookshop.Books as Books { Books.ID }`)
})

it('rejects unmanaged associations in expressions in GROUP BY clause (1)', () => {
Expand Down

0 comments on commit a9473d9

Please sign in to comment.