Skip to content
Snippets Groups Projects
Unverified Commit b303580b authored by Oisin Coveney's avatar Oisin Coveney Committed by GitHub
Browse files

Bottom corner radius on buttons looks weird on new dashboard grid (#31647)

parent 1185e21a
No related branches found
No related tags found
No related merge requests found
import {
editDashboard,
restore,
saveDashboard,
setActionsEnabledForDB,
visitDashboard,
} from "e2e/support/helpers";
import { SAMPLE_DB_ID } from "e2e/support/cypress_data";
const viewports = [
[768, 800],
[1024, 800],
[1440, 800],
];
describe("metabase#31587", () => {
viewports.forEach(([width, height]) => {
describe(`Testing on resolution ${width} x ${height}`, () => {
beforeEach(() => {
restore();
cy.signInAsAdmin();
setActionsEnabledForDB(SAMPLE_DB_ID);
cy.viewport(width, height);
});
it("should not allow action buttons to overflow when editing dashboard", () => {
visitDashboard(1);
editDashboard();
cy.button("Add action").click();
cy.findByTestId("dashboard-parameters-and-cards").within(() => {
const actionButtonContainer = cy.findByTestId(
"action-button-full-container",
);
const dashCard = cy.contains(".DashCard", "Click Me");
actionButtonContainer.then(actionButtonElem => {
dashCard.then(dashCardElem => {
expect(actionButtonElem[0].scrollHeight).to.eq(
dashCardElem[0].scrollHeight,
);
});
});
});
});
it("should not allow action buttons to overflow when viewing info sidebar", () => {
visitDashboard(1);
editDashboard();
cy.findByLabelText("Add action").click();
saveDashboard();
cy.icon("info").click();
cy.findByTestId("dashboard-parameters-and-cards").within(() => {
const actionButtonContainer = cy.findByTestId(
"action-button-full-container",
);
const dashCard = cy.contains(".DashCard", "Click Me");
actionButtonContainer.then(actionButtonElem => {
dashCard.then(dashCardElem => {
expect(actionButtonElem[0].scrollHeight).to.eq(
dashCardElem[0].scrollHeight,
);
});
});
});
});
});
});
});
......@@ -145,7 +145,7 @@ function ActionFn(props: ActionProps) {
return (
<Tooltip tooltip={tooltip}>
<FullContainer>
<FullContainer data-testid="action-button-full-container">
<ActionButtonView
disabled
icon="bolt"
......
......@@ -7,7 +7,9 @@ export const StyledButton = styled(Button)<{
isFullHeight?: boolean;
focus?: boolean;
}>`
padding: 0;
height: ${({ isFullHeight }) => (isFullHeight ? "100%" : "auto")};
${({ focus }) =>
focus
? `
......
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