Files
metabase/e2e/support/helpers/e2e-embedding-sdk-interactive-question-helpers.tsx
Kamil Mielnik 5a1d677444 RFC 118. Prettier - arrowParens: “always” (#55807)
* Update .prettierrc
- remove "arrowParens": "avoid" so that it defaults to "always" instead

* Run "yarn prettier"
2025-03-27 09:18:07 +00:00

47 lines
1.2 KiB
TypeScript

import {
entityPickerModal,
modal,
popover,
} from "e2e/support/helpers/e2e-ui-elements-helpers";
export function saveInteractiveQuestionAsNewQuestion(options: {
questionName: string;
entityName: string;
collectionPickerPath?: string[];
}) {
const { questionName, entityName, collectionPickerPath } = options;
cy.intercept("POST", "/api/card").as("createCard");
// eslint-disable-next-line no-unsafe-element-filtering
cy.findAllByTestId("cell-data").last().click();
popover().findByText(`See these ${entityName}`).click();
cy.findByRole("button", { name: "Save" }).click();
modal().within(() => {
cy.findByText("Save as new question").click();
cy.findByPlaceholderText("What is the name of your question?")
.clear()
.type(questionName);
});
if (collectionPickerPath) {
cy.findByTestId("dashboard-and-collection-picker-button").click();
entityPickerModal().within(() => {
cy.findByText("Browse").click();
collectionPickerPath.forEach((collectionName) =>
cy.findByText(collectionName).click(),
);
cy.findByRole("button", { name: "Select this collection" }).click();
});
}
modal().within(() => {
cy.findByRole("button", { name: "Save" }).click();
});
}