Skip to content

Commit

Permalink
E2E repro for "Fix issue with root collection in QuestionPicker" (#44318
Browse files Browse the repository at this point in the history
)
  • Loading branch information
ranquild committed Jun 18, 2024
1 parent 9c18d09 commit 191572d
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
5 changes: 5 additions & 0 deletions e2e/support/cypress_sample_instance_data.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ export const NO_DATA_PERSONAL_COLLECTION_ID = _.findWhere(
{ name: "No Data Tableton's Personal Collection" },
).id;

export const NO_COLLECTION_PERSONAL_COLLECTION_ID = _.findWhere(
SAMPLE_INSTANCE_DATA.collections,
{ name: "No Collection Tableton's Personal Collection" },
).id;

export const FIRST_COLLECTION_ID = _.findWhere(
SAMPLE_INSTANCE_DATA.collections,
{ name: "First collection" },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { WRITABLE_DB_ID, SAMPLE_DB_ID } from "e2e/support/cypress_data";
import { SAMPLE_DATABASE } from "e2e/support/cypress_sample_database";
import { NO_COLLECTION_PERSONAL_COLLECTION_ID } from "e2e/support/cypress_sample_instance_data";
import {
restore,
visualize,
Expand Down Expand Up @@ -27,6 +28,8 @@ import {
createQuestion,
saveQuestion,
echartsContainer,
newButton,
appBar,
} from "e2e/support/helpers";

const { ORDERS, ORDERS_ID, PRODUCTS } = SAMPLE_DATABASE;
Expand Down Expand Up @@ -684,3 +687,34 @@ describe("issue 10493", () => {
});
});
});

describe("issue 44071", () => {
const questionDetails = {
name: "Test",
query: { "source-table": ORDERS_ID },
collection_id: NO_COLLECTION_PERSONAL_COLLECTION_ID,
};

beforeEach(() => {
restore();
cy.signIn("nocollection");
createQuestion(questionDetails);
});

it("should be able to save questions based on another questions without collection access (metabase#44071)", () => {
cy.visit("/");
newButton("Question").click();
entityPickerModal().within(() => {
entityPickerModalTab("Saved questions").click();
cy.findByText(/Personal Collection/).click();
cy.findByText(questionDetails.name).click();
});
getNotebookStep("data")
.findByText(questionDetails.name)
.should("be.visible");
saveQuestion();
appBar()
.findByText(/Personal Collection/)
.should("be.visible");
});
});

0 comments on commit 191572d

Please sign in to comment.