-
Uladzimir Havenchyk authored
Add repro test for a model that uses another model and both have custom column with the same name (#40851) * Add repro test for a model that uses another model and both have custom column with the same name * Skip test * Update e2e/test/scenarios/models/reproductions/39150-model-with-same-custom-column-name.cy.spec.js Co-authored-by:
Kamil Mielnik <kamil@kamilmielnik.com> * Update e2e/test/scenarios/models/reproductions/39150-model-with-same-custom-column-name.cy.spec.js Co-authored-by:
Kamil Mielnik <kamil@kamilmielnik.com> * Convert to ts and add question --------- Co-authored-by:
Kamil Mielnik <kamil@kamilmielnik.com>
Uladzimir Havenchyk authoredAdd repro test for a model that uses another model and both have custom column with the same name (#40851) * Add repro test for a model that uses another model and both have custom column with the same name * Skip test * Update e2e/test/scenarios/models/reproductions/39150-model-with-same-custom-column-name.cy.spec.js Co-authored-by:
Kamil Mielnik <kamil@kamilmielnik.com> * Update e2e/test/scenarios/models/reproductions/39150-model-with-same-custom-column-name.cy.spec.js Co-authored-by:
Kamil Mielnik <kamil@kamilmielnik.com> * Convert to ts and add question --------- Co-authored-by:
Kamil Mielnik <kamil@kamilmielnik.com>
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
39150-model-with-same-custom-column-name.cy.spec.ts 1.33 KiB
import { SAMPLE_DATABASE } from "e2e/support/cypress_sample_database";
import { createQuestion, restore } from "e2e/support/helpers";
const { ORDERS_ID, ORDERS } = SAMPLE_DATABASE;
// TODO: unskip once 39150 is fixed
describe.skip("issue 39150", () => {
beforeEach(() => {
restore();
cy.signInAsAdmin();
});
["model", "question"].forEach(type => {
it(`should render results if a ${type} depends on a ${type} and both have the same custom column name (metabase#39150)`, () => {
createQuestion({
type,
name: `${type} 39150`,
query: {
"source-table": ORDERS_ID,
expressions: {
Total: ["+", ["field", ORDERS.TOTAL, null], 1],
},
limit: 5,
},
}).then(({ body: { id: questionId } }) => {
createQuestion(
{
type,
name: `${type} 39150 Child`,
query: {
"source-table": `card__${questionId}`,
expressions: {
Total: ["+", ["field", ORDERS.TOTAL, null], 1],
},
},
},
{ visitQuestion: true },
);
});
cy.log("verify that rendered result has 3 'Total' columns");
cy.findAllByTestId("header-cell")
.filter(":contains('Total')")
.should("have.length", 3);
});
});
});