Skip to content
Snippets Groups Projects
Unverified Commit 5bde4b88 authored by Nick Fitzpatrick's avatar Nick Fitzpatrick Committed by GitHub
Browse files

adding hasMultipleDimensions check to hasLegend clause (#29160)

* adding hasMultipleDimensions check to hasLegend clause

* Adding queryBuilderMain helper

* PR Feedback

* remove only
parent 289116c3
No related merge requests found
......@@ -95,3 +95,7 @@ export const moveColumnDown = (column, distance) => {
.trigger("mousemove", 0, distance * 50, { force: true })
.trigger("mouseup", 0, distance * 50, { force: true });
};
export const queryBuilderMain = () => {
return cy.findByTestId("query-builder-main");
};
......@@ -4,6 +4,7 @@ import {
popover,
visitDashboard,
openSeriesSettings,
queryBuilderMain,
} from "e2e/support/helpers";
import { SAMPLE_DB_ID } from "e2e/support/cypress_data";
......@@ -415,8 +416,13 @@ describe("scenarios > visualizations > line chart", () => {
cy.findByText("Category is Doohickey");
});
it.skip("should not drop the chart legend (metabase#4995)", () => {
it("should not drop the chart legend (metabase#4995)", () => {
cy.findAllByTestId("legend-item").should("contain", "Doohickey");
cy.log("Ensure that legend is hidden when not dealing with multi series");
cy.findByTestId("viz-settings-button").click();
cy.findByTestId("remove-CATEGORY").click();
queryBuilderMain().should("not.contain", "Doohickey");
});
it("should display correct axis labels (metabase#12782)", () => {
......
......@@ -345,7 +345,10 @@ class View extends React.Component {
const isSidebarOpen = leftSidebar || rightSidebar;
return (
<QueryBuilderMain isSidebarOpen={isSidebarOpen}>
<QueryBuilderMain
isSidebarOpen={isSidebarOpen}
data-testid="query-builder-main"
>
{isNative ? (
this.renderNativeQueryEditor()
) : (
......
......@@ -275,7 +275,8 @@ export default class LineAreaBarChart extends Component {
const hasMultipleSeries = series.length > 1;
const canChangeSeries = onAddSeries || onEditSeries || onRemoveSeries;
const hasLegendButtons = !hasTitle && actionButtons;
const hasLegend = hasMultipleSeries || canChangeSeries || hasLegendButtons;
const hasLegend =
hasMultipleSeries || canChangeSeries || hasLegendButtons || hasBreakout;
const seriesSettings =
settings.series && series.map(single => settings.series(single));
......
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