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

#14775 Repro: Custom column not removed when a join is removed [ci skip] (#14821)

parent 53f43115
No related branches found
No related tags found
No related merge requests found
......@@ -385,4 +385,62 @@ describe("scenarios > question > custom columns", () => {
cy.findByText("Gizmo2");
});
});
it.skip("should drop custom column (based on a joined field) when a join is removed (metabase#14775)", () => {
const CE_NAME = "Rounded price";
cy.request("POST", "/api/card", {
name: "14775",
dataset_query: {
database: 1,
query: {
"source-table": ORDERS_ID,
joins: [
{
fields: "all",
"source-table": PRODUCTS_ID,
condition: [
"=",
["field-id", ORDERS.PRODUCT_ID],
["joined-field", "Products", ["field-id", PRODUCTS.ID]],
],
alias: "Products",
},
],
expressions: {
[CE_NAME]: [
"ceil",
["joined-field", "Products", ["field-id", PRODUCTS.PRICE]],
],
},
},
type: "query",
},
display: "table",
visualization_settings: {},
}).then(({ body: { id: QUESTION_ID } }) => {
cy.server();
cy.route("POST", "/api/dataset").as("dataset");
cy.visit(`/question/${QUESTION_ID}/notebook`);
});
// Remove join
cy.findByText("Join data")
.parent()
.find(".Icon-close")
.click({ force: true }); // x is hidden and hover doesn't work so we have to force it
cy.findByText("Join data").should("not.exist");
cy.log("**Reported failing on 0.38.1-SNAPSHOT (6d77f099)**");
cy.get("[class*=NotebookCellItem]")
.contains(CE_NAME)
.should("not.exist");
cy.findByText("Visualize").click();
cy.wait("@dataset").then(xhr => {
expect(xhr.response.body.error).to.not.exist;
});
cy.contains("37.65");
});
});
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