Skip to content
Snippets Groups Projects
Unverified Commit 0511c9c2 authored by Kamil Mielnik's avatar Kamil Mielnik Committed by GitHub
Browse files

Repro #36122 - Table Metadata having 2 foreign keys from the same table...

Repro #36122 - Table Metadata having 2 foreign keys from the same table pointing to the same key cause implicit joins to only show 1 (#38085)

* Add a repro for 36122

* Improve assertions
parent 8de2a873
Branches
Tags
No related merge requests found
import {
getNotebookStep,
restore,
openOrdersTable,
openReviewsTable,
......@@ -9,7 +10,7 @@ import {
import { SAMPLE_DB_ID, SAMPLE_DB_SCHEMA_ID } from "e2e/support/cypress_data";
import { SAMPLE_DATABASE } from "e2e/support/cypress_sample_database";
const { ORDERS, ORDERS_ID, REVIEWS, REVIEWS_ID } = SAMPLE_DATABASE;
const { ORDERS, ORDERS_ID, PRODUCTS, REVIEWS, REVIEWS_ID } = SAMPLE_DATABASE;
describe("scenarios > admin > datamodel > metadata", () => {
beforeEach(() => {
......@@ -132,6 +133,29 @@ describe("scenarios > admin > datamodel > metadata", () => {
.should("have.length", 1);
});
it("should display breakouts group for all FKs (metabase#36122)", () => {
cy.request("PUT", `/api/field/${REVIEWS.RATING}`, {
semantic_type: "type/FK",
fk_target_field_id: PRODUCTS.ID,
});
openReviewsTable({ mode: "notebook" });
summarize({ mode: "notebook" });
getNotebookStep("summarize")
.findByText("Pick a column to group by")
.click();
popover().within(() => {
cy.findAllByTestId("dimension-list-item")
.eq(3)
.should("have.text", "Rating");
cy.get(".List-section-header").should("have.length", 3);
cy.get(".List-section-header").eq(0).should("have.text", "Review");
cy.get(".List-section-header").eq(1).should("have.text", "Product");
cy.get(".List-section-header").eq(2).should("have.text", "Rating");
});
});
it("display value 'custom mapping' should be available regardless of the chosen filtering type (metabase#16322)", () => {
cy.visit(
`/admin/datamodel/database/${SAMPLE_DB_ID}/schema/${SAMPLE_DB_SCHEMA_ID}/table/${REVIEWS_ID}/field/${REVIEWS.RATING}/general`,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment