Skip to content
Snippets Groups Projects
Unverified Commit a4fb40e4 authored by Uladzimir Havenchyk's avatar Uladzimir Havenchyk Committed by GitHub
Browse files

Add repro test for a model that uses another model and both have custom column...

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: default avatarKamil Mielnik <kamil@kamilmielnik.com>

* Update e2e/test/scenarios/models/reproductions/39150-model-with-same-custom-column-name.cy.spec.js

Co-authored-by: default avatarKamil Mielnik <kamil@kamilmielnik.com>

* Convert to ts and add question

---------

Co-authored-by: default avatarKamil Mielnik <kamil@kamilmielnik.com>
parent c27b0a35
No related branches found
No related tags found
No related merge requests found
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);
});
});
});
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