Skip to content
Snippets Groups Projects
Unverified Commit d56dd469 authored by Mahatthana (Kelvin) Nomsawadi's avatar Mahatthana (Kelvin) Nomsawadi Committed by GitHub
Browse files

Add test to cannot use click behavior on boolean columns on MySQL (#33400)

* Add missing types in Cypress

* Add a repro for metabase#18067
parent 5116f76b
No related merge requests found
......@@ -62,7 +62,7 @@ export function getDashboardCardMenu(index = 0) {
}
export function showDashboardCardActions(index = 0) {
getDashboardCard(index).realHover();
getDashboardCard(index).realHover({ scrollBehavior: "bottom" });
}
export function removeDashboardCard(index = 0) {
......
import {
addOrUpdateDashboardCard,
restore,
resetTestTable,
resyncDatabase,
visitDashboard,
editDashboard,
showDashboardCardActions,
sidebar,
} from "e2e/support/helpers";
import { SAMPLE_DATABASE } from "e2e/support/cypress_sample_database";
import { WRITABLE_DB_ID } from "e2e/support/cypress_data";
const { ORDERS, ORDERS_ID, PRODUCTS, PRODUCTS_ID, REVIEWS, REVIEWS_ID } =
SAMPLE_DATABASE;
......@@ -192,6 +198,51 @@ describe("scenarios > dashboard > dashboard cards > click behavior", () => {
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
cy.findByText("Orders");
});
it(
"should allow settings click behavior on boolean fields (metabase#18067)",
{ tags: "@external" },
() => {
const dialect = "mysql";
const TEST_TABLE = "many_data_types";
resetTestTable({ type: dialect, table: TEST_TABLE });
restore(`${dialect}-writable`);
cy.signInAsAdmin();
resyncDatabase({
dbId: WRITABLE_DB_ID,
tableName: TEST_TABLE,
tableAlias: "testTable",
});
cy.get("@testTable").then(testTable => {
const dashboardDetails = {
name: "18067 dashboard",
};
const questionDetails = {
name: "18067 question",
database: WRITABLE_DB_ID,
query: { "source-table": testTable.id },
};
cy.createQuestionAndDashboard({
dashboardDetails,
questionDetails,
}).then(({ body: { dashboard_id } }) => {
visitDashboard(dashboard_id);
});
});
editDashboard();
cy.log('Select "click behavior" option');
showDashboardCardActions();
cy.findByTestId("dashboardcard-actions-panel").icon("click").click();
sidebar().within(() => {
cy.findByText("Boolean").scrollIntoView().click();
cy.contains("Click behavior for Boolean").should("be.visible");
});
},
);
});
const getQuestionDetails = ({ display }) => ({
......
......@@ -3,7 +3,7 @@
"compilerOptions": {
"outDir": "build",
"baseUrl": "./",
"types": ["cypress", "@testing-library/cypress"],
"types": ["cypress", "@testing-library/cypress", "cypress-real-events"],
"paths": {
"*": ["../frontend/src/*"],
"e2e/*": ["./*"]
......
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