Skip to content
Snippets Groups Projects
Commit 2e6d4167 authored by Martin Weise's avatar Martin Weise
Browse files

fixed frontend e2e tests

Former-commit-id: 0992cb74
parent 56c310b7
No related branches found
No related tags found
1 merge request!42Fixed the query service tests
...@@ -5,7 +5,7 @@ test('simple select', (t) => { ...@@ -5,7 +5,7 @@ test('simple select', (t) => {
const r = buildQuery({ const r = buildQuery({
table: 'Table' table: 'Table'
}) })
t.is(r.sql, 'select * from "Table"') t.is(r.sql, 'select * from `Table`')
}) })
test('select some columns', (t) => { test('select some columns', (t) => {
...@@ -13,7 +13,7 @@ test('select some columns', (t) => { ...@@ -13,7 +13,7 @@ test('select some columns', (t) => {
table: 'Table', table: 'Table',
select: ['database', 'bbb'] select: ['database', 'bbb']
}) })
t.is(r.sql, 'select "database", "bbb" from "Table"') t.is(r.sql, 'select `database`, `bbb` from `Table`')
}) })
test('simple where clause', (t) => { test('simple where clause', (t) => {
...@@ -23,7 +23,7 @@ test('simple where clause', (t) => { ...@@ -23,7 +23,7 @@ test('simple where clause', (t) => {
{ type: 'where', params: ['foo', '=', 42] } { type: 'where', params: ['foo', '=', 42] }
] ]
}) })
t.is(r.sql, 'select * from "Table" where "foo" = 42') t.is(r.sql, 'select * from `Table` where `foo` = 42')
}) })
test('simple where clause with numeric string', (t) => { test('simple where clause with numeric string', (t) => {
...@@ -33,7 +33,7 @@ test('simple where clause with numeric string', (t) => { ...@@ -33,7 +33,7 @@ test('simple where clause with numeric string', (t) => {
{ type: 'where', params: ['foo', '=', '42'] } { type: 'where', params: ['foo', '=', '42'] }
] ]
}) })
t.is(r.sql, 'select * from "Table" where "foo" = 42') t.is(r.sql, 'select * from `Table` where `foo` = 42')
}) })
test('simple where clause with non-numeric string', (t) => { test('simple where clause with non-numeric string', (t) => {
...@@ -43,7 +43,7 @@ test('simple where clause with non-numeric string', (t) => { ...@@ -43,7 +43,7 @@ test('simple where clause with non-numeric string', (t) => {
{ type: 'where', params: ['foo', '=', 'bla'] } { type: 'where', params: ['foo', '=', 'bla'] }
] ]
}) })
t.is(r.sql, 'select * from "Table" where "foo" = \'bla\'') t.is(r.sql, 'select * from `Table` where `foo` = \'bla\'')
}) })
test('using unallowed operator', (t) => { test('using unallowed operator', (t) => {
...@@ -57,7 +57,7 @@ test('using unallowed operator', (t) => { ...@@ -57,7 +57,7 @@ test('using unallowed operator', (t) => {
t.is(r.error, 'The operator "UNKNOWN" is not permitted') t.is(r.error, 'The operator "UNKNOWN" is not permitted')
}) })
test('where clause with explicit "and"', (t) => { test('where clause with explicit `and`', (t) => {
const r = buildQuery({ const r = buildQuery({
table: 'Table', table: 'Table',
clauses: [ clauses: [
...@@ -66,10 +66,10 @@ test('where clause with explicit "and"', (t) => { ...@@ -66,10 +66,10 @@ test('where clause with explicit "and"', (t) => {
{ type: 'where', params: ['bar', '=', 42] } { type: 'where', params: ['bar', '=', 42] }
] ]
}) })
t.is(r.sql, 'select * from "Table" where "foo" = 42 and "bar" = 42') t.is(r.sql, 'select * from `Table` where `foo` = 42 and `bar` = 42')
}) })
test('where clause with implicit "and"', (t) => { test('where clause with implicit `and`', (t) => {
const r = buildQuery({ const r = buildQuery({
table: 'Table', table: 'Table',
clauses: [ clauses: [
...@@ -78,10 +78,10 @@ test('where clause with implicit "and"', (t) => { ...@@ -78,10 +78,10 @@ test('where clause with implicit "and"', (t) => {
{ type: 'where', params: ['bar', '=', 42] } { type: 'where', params: ['bar', '=', 42] }
] ]
}) })
t.is(r.sql, 'select * from "Table" where "foo" = 42 and "bar" = 42') t.is(r.sql, 'select * from `Table` where `foo` = 42 and `bar` = 42')
}) })
test('where clause with "or"', (t) => { test('where clause with `or`', (t) => {
const r = buildQuery({ const r = buildQuery({
table: 'Table', table: 'Table',
clauses: [ clauses: [
...@@ -90,7 +90,7 @@ test('where clause with "or"', (t) => { ...@@ -90,7 +90,7 @@ test('where clause with "or"', (t) => {
{ type: 'where', params: ['bar', '=', 42] } { type: 'where', params: ['bar', '=', 42] }
] ]
}) })
t.is(r.sql, 'select * from "Table" where "foo" = 42 or "bar" = 42') t.is(r.sql, 'select * from `Table` where `foo` = 42 or `bar` = 42')
}) })
test('cast numeric strings to numbers', (t) => { test('cast numeric strings to numbers', (t) => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment