Skip to content
Snippets Groups Projects
Unverified Commit ce5e64af authored by Nemanja Glumac's avatar Nemanja Glumac Committed by GitHub
Browse files

Repro #19744: Custom Column after aggregation causes dashboard filtering to be...

Repro #19744: Custom Column after aggregation causes dashboard filtering to be very limited (#20696)
parent 3eef27a3
No related branches found
No related tags found
No related merge requests found
import {
restore,
editDashboard,
visitQuestionAdhoc,
popover,
} from "__support__/e2e/cypress";
import { SAMPLE_DATABASE } from "__support__/e2e/cypress_sample_database";
const { PRODUCTS_ID, PRODUCTS } = SAMPLE_DATABASE;
const questionDetails = {
dataset_query: {
type: "query",
query: {
"source-query": {
"source-table": PRODUCTS_ID,
aggregation: [
["count"],
["sum", ["field", PRODUCTS.PRICE, null]],
["sum", ["field", PRODUCTS.RATING, null]],
],
breakout: [["field", PRODUCTS.CATEGORY, null]],
},
expressions: { Math: ["+", 1, 1] },
},
database: 1,
},
display: "bar",
};
describe.skip("issue 19744", () => {
beforeEach(() => {
restore();
cy.signInAsAdmin();
// For this specific repro, it's crucial to first visit the question in order to load the `results_metadata`...
visitQuestionAdhoc(questionDetails);
// ...and then to save it using the UI
saveQuestion("19744");
addQuestionToDashboardAndVisit();
});
it("custom column after aggregation shouldn't limit or change the behavior of dashboard filters (metabase#19744)", () => {
editDashboard();
cy.icon("filter").click();
cy.findByText("Time").click();
cy.findByText("All Options").click();
cy.get(".DashCard")
.contains("Select…")
.click();
popover().contains("Created At");
});
});
function saveQuestion(name) {
cy.intercept("POST", "/api/card").as("saveQuestion");
cy.findByText("Save").click();
cy.findByLabelText("Name").type(name);
cy.get(".Modal")
.button("Save")
.click();
cy.findByText("Not now").click();
cy.wait("@saveQuestion").then(({ response: { body } }) => {
cy.wrap(body.id).as("questionId");
});
}
function addQuestionToDashboardAndVisit() {
cy.createDashboard().then(({ body: { id } }) => {
cy.get("@questionId").then(cardId => {
cy.request("POST", `/api/dashboard/${id}/cards`, {
cardId,
sizeX: 16,
sizeY: 10,
});
});
cy.visit(`/dashboard/${id}`);
});
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment