Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
DBRepo
Manage
Activity
Members
Labels
Plan
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FAIR Data Austria DB Repository
DBRepo
Commits
2e6d4167
Commit
2e6d4167
authored
3 years ago
by
Martin Weise
Browse files
Options
Downloads
Patches
Plain Diff
fixed frontend e2e tests
Former-commit-id:
0992cb74
parent
56c310b7
No related branches found
No related tags found
1 merge request
!42
Fixed the query service tests
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
fda-ui/test/unit/query.js
+11
-11
11 additions, 11 deletions
fda-ui/test/unit/query.js
with
11 additions
and
11 deletions
fda-ui/test/unit/query.js
+
11
−
11
View file @
2e6d4167
...
...
@@ -5,7 +5,7 @@ test('simple select', (t) => {
const
r
=
buildQuery
({
table
:
'
Table
'
})
t
.
is
(
r
.
sql
,
'
select * from
"
Table
"
'
)
t
.
is
(
r
.
sql
,
'
select * from
`
Table
`
'
)
})
test
(
'
select some columns
'
,
(
t
)
=>
{
...
...
@@ -13,7 +13,7 @@ test('select some columns', (t) => {
table
:
'
Table
'
,
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
)
=>
{
...
...
@@ -23,7 +23,7 @@ test('simple where clause', (t) => {
{
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
)
=>
{
...
...
@@ -33,7 +33,7 @@ test('simple where clause with numeric string', (t) => {
{
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
)
=>
{
...
...
@@ -43,7 +43,7 @@ test('simple where clause with non-numeric string', (t) => {
{
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
)
=>
{
...
...
@@ -57,7 +57,7 @@ test('using unallowed operator', (t) => {
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
({
table
:
'
Table
'
,
clauses
:
[
...
...
@@ -66,10 +66,10 @@ test('where clause with explicit "and"', (t) => {
{
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
({
table
:
'
Table
'
,
clauses
:
[
...
...
@@ -78,10 +78,10 @@ test('where clause with implicit "and"', (t) => {
{
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
({
table
:
'
Table
'
,
clauses
:
[
...
...
@@ -90,7 +90,7 @@ test('where clause with "or"', (t) => {
{
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
)
=>
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment