Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Engineering Digital Service
Metabase
Commits
7fd60eb8
Commit
7fd60eb8
authored
8 years ago
by
Tom Robinson
Browse files
Options
Downloads
Patches
Plain Diff
Remove old Query spec
parent
9dd7abaa
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
frontend/test/unit/meta/Query.spec.js
+0
-38
0 additions, 38 deletions
frontend/test/unit/meta/Query.spec.js
with
0 additions
and
38 deletions
frontend/test/unit/meta/Query.spec.js
deleted
100644 → 0
+
0
−
38
View file @
9dd7abaa
import
*
as
Query
from
"
metabase/meta/Query
"
;
describe
(
"
Query
"
,
()
=>
{
describe
(
"
addFilter()
"
,
()
=>
{
it
(
"
should add a filter when none exists
"
,
()
=>
{
let
result
=
Query
.
addFilter
({},
[
"
=
"
,
1
,
2
]);
expect
(
result
).
toEqual
({
filters
:
[
"
=
"
,
1
,
2
]});
});
it
(
"
should AND existing filter with new filter
"
,
()
=>
{
let
result
=
Query
.
addFilter
({
filters
:
[
"
=
"
,
1
,
2
]
},
[
"
=
"
,
3
,
4
]);
expect
(
result
).
toEqual
({
filters
:
[
"
and
"
,
[
"
=
"
,
1
,
2
],
[
"
=
"
,
3
,
4
]]
});
});
it
(
"
should concatenate a filter to existing ANDed filters
"
,
()
=>
{
let
result
=
Query
.
addFilter
({
filters
:
[
"
and
"
,
[
"
=
"
,
1
,
2
],
[
"
=
"
,
3
,
4
]]
},
[
"
=
"
,
5
,
6
]);
expect
(
result
).
toEqual
({
filters
:
[
"
and
"
,
[
"
=
"
,
1
,
2
],
[
"
=
"
,
3
,
4
],
[
"
=
"
,
5
,
6
]]
});
});
});
describe
(
"
removeFilter()
"
,
()
=>
{
it
(
"
should remove entire filter clause if last filter is removed
"
,
()
=>
{
let
result
=
Query
.
removeFilter
({
filters
:
[
"
=
"
,
1
,
2
]},
0
);
expect
(
result
).
toEqual
({
});
});
it
(
"
should remove AND clause if only one filter remains
"
,
()
=>
{
let
result
=
Query
.
removeFilter
({
filters
:
[
"
and
"
,
[
"
=
"
,
1
,
2
],
[
"
=
"
,
3
,
4
]]
},
0
);
expect
(
result
).
toEqual
({
filters
:
[
"
=
"
,
3
,
4
]
});
});
it
(
"
should remove correct filter
"
,
()
=>
{
let
result
=
Query
.
removeFilter
({
filters
:
[
"
and
"
,
[
"
=
"
,
1
,
2
],
[
"
=
"
,
3
,
4
],
[
"
=
"
,
5
,
6
]]
},
1
);
expect
(
result
).
toEqual
({
filters
:
[
"
and
"
,
[
"
=
"
,
1
,
2
],
[
"
=
"
,
5
,
6
]]
});
});
});
describe
(
"
updateFilter()
"
,
()
=>
{
it
(
"
should update correct filter
"
,
()
=>
{
let
result
=
Query
.
updateFilter
({
filters
:
[
"
and
"
,
[
"
=
"
,
1
,
2
],
[
"
=
"
,
3
,
4
],
[
"
=
"
,
5
,
6
]]
},
1
,
[
"
=
"
,
7
,
8
]);
expect
(
result
).
toEqual
({
filters
:
[
"
and
"
,
[
"
=
"
,
1
,
2
],
[
"
=
"
,
7
,
8
],
[
"
=
"
,
5
,
6
]]
});
});
});
});
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