-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port metric v1 e2e tests #42125
Port metric v1 e2e tests #42125
Changes from all commits
231b917
1d9be23
c81e074
777786f
925e554
a4276ec
264210b
b962027
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,6 @@ import { | |
visitQuestion, | ||
cartesianChartCircle, | ||
} from "e2e/support/helpers"; | ||
import { createMetric as apiCreateMetric } from "e2e/support/helpers/e2e-table-metadata-helpers"; | ||
|
||
const { ORDERS, ORDERS_ID } = SAMPLE_DATABASE; | ||
|
||
|
@@ -16,30 +15,29 @@ describe("issue 6010", () => { | |
cy.intercept("POST", "/api/dataset").as("dataset"); | ||
}); | ||
|
||
// FIXME metrics v2 | ||
it.skip("should apply the filter from a metric when drilling through (metabase#6010)", () => { | ||
it("should apply the filter from a metric when drilling through (metabase#6010)", () => { | ||
createMetric() | ||
.then(({ body: { id } }) => createQuestion(id)) | ||
.then(({ body: { id } }) => visitQuestion(id)); | ||
|
||
cartesianChartCircle().eq(0).click(); | ||
|
||
popover().findByText("See these Orders").click(); | ||
popover().findByText("See these Metrics").click(); | ||
cy.wait("@dataset"); | ||
|
||
cy.findByTestId("qb-filters-panel").within(() => { | ||
cy.findByText("Total is greater than 150").should("be.visible"); | ||
cy.findByText("Created At is Jan 1–31, 2024").should("be.visible"); | ||
}); | ||
// FIXME metrics v2 -- check that the values in column Total are above 150 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure how to do this best. Ideally, we would like to check that the filter is still in effect, but I don't think it should be listed as it's part of the metric which is still the source. |
||
}); | ||
}); | ||
|
||
const createMetric = () => { | ||
return apiCreateMetric({ | ||
return cy.createQuestion({ | ||
name: "Metric", | ||
description: "Metric with a filter", | ||
table_id: ORDERS_ID, | ||
definition: { | ||
type: "metric", | ||
query: { | ||
"source-table": ORDERS_ID, | ||
filter: [">", ORDERS.TOTAL, 150], | ||
aggregation: [["count"]], | ||
|
@@ -52,7 +50,7 @@ const createQuestion = metric_id => { | |
name: "Question", | ||
display: "line", | ||
query: { | ||
"source-table": ORDERS_ID, | ||
"source-table": `card__${metric_id}`, | ||
breakout: [["field", ORDERS.CREATED_AT, { "temporal-unit": "month" }]], | ||
aggregation: [["metric", metric_id]], | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,9 +75,7 @@ describe("parameters/utils/mapping-options", () => { | |
}); | ||
}); | ||
|
||
// FIXME metrics v2 | ||
// eslint-disable-next-line jest/no-disabled-tests | ||
it.skip("should return fields from the model question's virtual card table, as though it is already nested", () => { | ||
it("should return fields from the model question's virtual card table, as though it is already nested", () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can't see how this is related to metrics, so I think it should pass. |
||
const options = getParameterMappingOptions( | ||
new Question(dataset.card(), metadata), | ||
{ type: "date/single" }, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,9 +70,7 @@ describe("QueryBuilder - unsaved changes warning", () => { | |
expect(screen.getByTestId("leave-confirmation")).toBeInTheDocument(); | ||
}); | ||
|
||
// FIXME metrics v2 | ||
// eslint-disable-next-line jest/no-disabled-tests | ||
it.skip("does not show custom warning modal when saving new model", async () => { | ||
it("does not show custom warning modal when saving new model", async () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can't see how this is related to metrics, so I think it should pass. |
||
await setup({ | ||
card: null, | ||
initialRoute: "/model/new", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scavenged from the admin metrics tests.