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
3fdf9da0
Unverified
Commit
3fdf9da0
authored
3 years ago
by
Nemanja Glumac
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
#11503 Repros: Filters from dashboard not used in question (#16627)
parent
ec33a15d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
frontend/test/metabase/scenarios/dashboard/dashboard-drill.cy.spec.js
+118
-0
118 additions, 0 deletions
...t/metabase/scenarios/dashboard/dashboard-drill.cy.spec.js
with
118 additions
and
0 deletions
frontend/test/metabase/scenarios/dashboard/dashboard-drill.cy.spec.js
+
118
−
0
View file @
3fdf9da0
...
...
@@ -725,6 +725,117 @@ describe("scenarios > dashboard > dashboard drill", () => {
});
});
});
describe
(
"
should preserve dashboard filter and apply it to the question on a drill-through (metabase#11503)
"
,
()
=>
{
const
ordersIdFilter
=
{
name
:
"
Orders ID
"
,
slug
:
"
orders_id
"
,
id
:
"
82a5a271
"
,
type
:
"
id
"
,
sectionId
:
"
id
"
,
};
const
productsIdFilter
=
{
name
:
"
Products ID
"
,
slug
:
"
products_id
"
,
id
:
"
a4dc1976
"
,
type
:
"
id
"
,
sectionId
:
"
id
"
,
};
const
parameters
=
[
ordersIdFilter
,
productsIdFilter
];
beforeEach
(()
=>
{
// Add filters to the dashboard
cy
.
request
(
"
PUT
"
,
"
/api/dashboard/1
"
,
{
parameters
,
});
// Connect those filters to the existing dashboard card
cy
.
request
(
"
PUT
"
,
"
/api/dashboard/1/cards
"
,
{
cards
:
[
{
id
:
1
,
card_id
:
1
,
row
:
0
,
col
:
0
,
sizeX
:
12
,
sizeY
:
8
,
series
:
[],
visualization_settings
:
{},
parameter_mappings
:
[
{
parameter_id
:
ordersIdFilter
.
id
,
card_id
:
1
,
target
:
[
"
dimension
"
,
[
"
field
"
,
ORDERS
.
ID
,
null
]],
},
{
parameter_id
:
productsIdFilter
.
id
,
card_id
:
1
,
target
:
[
"
dimension
"
,
[
"
field
"
,
PRODUCTS
.
ID
,
{
"
source-field
"
:
ORDERS
.
PRODUCT_ID
,
},
],
],
},
],
},
],
});
cy
.
visit
(
"
/dashboard/1
"
);
});
it
(
"
should correctly drill-through on Orders filter (metabase#11503-1)
"
,
()
=>
{
setFilterValue
(
ordersIdFilter
.
name
);
drillThroughCardTitle
(
"
Orders
"
);
cy
.
findByText
(
"
37.65
"
);
cy
.
findByText
(
"
110.93
"
);
cy
.
findByText
(
"
52.72
"
).
should
(
"
not.exist
"
);
cy
.
findByText
(
"
Showing 2 rows
"
);
postDrillAssertion
();
});
it
(
"
should correctly drill-through on Products filter (metabase#11503-2)
"
,
()
=>
{
setFilterValue
(
productsIdFilter
.
name
);
drillThroughCardTitle
(
"
Orders
"
);
cy
.
findByText
(
"
37.65
"
).
should
(
"
not.exist
"
);
cy
.
findAllByText
(
"
105.12
"
);
cy
.
findByText
(
"
Showing 191 rows
"
);
postDrillAssertion
();
});
function
setFilterValue
(
filterName
)
{
cy
.
get
(
"
fieldset
"
)
.
contains
(
filterName
)
.
click
();
cy
.
findByPlaceholderText
(
"
Enter an ID
"
).
type
(
"
1,2,
"
);
cy
.
button
(
"
Add filter
"
).
click
();
cy
.
findByText
(
"
2 selections
"
);
}
function
postDrillAssertion
()
{
cy
.
findByText
(
"
ID is 2 selections
"
).
click
();
popover
().
within
(()
=>
{
cy
.
get
(
"
li
"
)
.
should
(
"
have.length
"
,
3
)
// The third one is an input field
.
and
(
"
contain
"
,
"
1
"
)
.
and
(
"
contain
"
,
"
2
"
);
cy
.
findByText
(
"
Update filter
"
);
});
}
});
});
function
createDashboardWithQuestion
(
...
...
@@ -806,3 +917,10 @@ function setParamValue(paramName, text) {
cy
.
findByText
(
"
Add filter
"
).
click
();
});
}
function
drillThroughCardTitle
(
title
)
{
cy
.
get
(
"
.Card-title
"
)
.
contains
(
title
)
.
click
();
cy
.
contains
(
`Started from
${
title
}
`
);
}
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