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

Repro #24839: Can't aggregate if source is the aggregated question (#27396)

parent 5863b1f4
No related branches found
No related tags found
No related merge requests found
import { restore, visitQuestionAdhoc, popover } from "__support__/e2e/helpers";
import { SAMPLE_DB_ID } from "__support__/e2e/cypress_data";
import { SAMPLE_DATABASE } from "__support__/e2e/cypress_sample_database";
const { ORDERS, ORDERS_ID } = SAMPLE_DATABASE;
const questionDetails = {
name: "24839",
query: {
"source-table": ORDERS_ID,
aggregation: [
["sum", ["field", ORDERS.QUANTITY, null]],
["avg", ["field", ORDERS.TOTAL, null]],
],
breakout: [["field", ORDERS.CREATED_AT, { "temporal-unit": "month" }]],
},
display: "line",
};
describe("issue 24839: should be able to summarize a nested question based on the source question with aggregations (metabase#24839)", () => {
beforeEach(() => {
restore();
cy.signInAsAdmin();
cy.createQuestion(questionDetails).then(({ body: { id } }) => {
// Start ad-hoc nested question based on the saved one
visitQuestionAdhoc({
dataset_query: {
database: SAMPLE_DB_ID,
query: { "source-table": `card__${id}` },
type: "query",
},
});
});
});
it.skip("from the notebook GUI (metabase#24839-1)", () => {
cy.icon("notebook").click();
cy.findByText("Summarize").click();
cy.findByText("Sum of ...").click();
popover()
.should("contain", "Sum of Quantity")
.and("contain", "Average of Total");
});
it("from a table header cell (metabase#24839-2)", () => {
cy.findAllByTestId("header-cell").contains("Average of Total").click();
popover().contains("Distinct values").click();
cy.get(".ScalarValue").invoke("text").should("eq", "49");
cy.findByTestId("aggregation-item")
.invoke("text")
.should("eq", "Distinct values of Average of Total");
});
});
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