diff --git a/frontend/test/metabase/scenarios/visualizations/reproductions/27427-static-viz-divide-by-zero.cy.spec.js b/frontend/test/metabase/scenarios/visualizations/reproductions/27427-static-viz-divide-by-zero.cy.spec.js index 848587ef32cf8a3041c2db70b09d351054ebebce..75b74764d5579935c6e0a50992dd3edd40fde05e 100644 --- a/frontend/test/metabase/scenarios/visualizations/reproductions/27427-static-viz-divide-by-zero.cy.spec.js +++ b/frontend/test/metabase/scenarios/visualizations/reproductions/27427-static-viz-divide-by-zero.cy.spec.js @@ -16,7 +16,7 @@ const questionDetails = { }, }; -describe.skip("issue 27427", () => { +describe("issue 27427", () => { beforeEach(() => { restore(); cy.signInAsAdmin(); diff --git a/src/metabase/pulse/render/body.clj b/src/metabase/pulse/render/body.clj index 13799d31f2474c54b2aa87925222fb2d78ba7745..7a391f3e4b59b84ac70a9d344f7cb48cf02a758c 100644 --- a/src/metabase/pulse/render/body.clj +++ b/src/metabase/pulse/render/body.clj @@ -548,7 +548,10 @@ [col-a col-b] (let [[min-a min-b] (map #(get-in % [:fingerprint :type :type/Number :min]) [col-a col-b]) [max-a max-b] (map #(get-in % [:fingerprint :type :type/Number :max]) [col-a col-b]) - valid-ranges? (and min-a min-b max-a max-b) + valid-ranges? (and min-a min-b max-a max-b + ;; ranges with same min and max won't be considered ranges. + (not= min-a max-a) + (not= min-b max-b)) overlapping-and-valid? (and valid-ranges? (or (<= min-a min-b max-a) (<= min-a max-b max-a)))] @@ -739,7 +742,6 @@ series-seqs [(if (= (count x-cols) 1) (single-x-axis-combo-series enforced-type joined-rows x-cols y-cols data card-name) (double-x-axis-combo-series enforced-type joined-rows x-cols y-cols data card-name))] - labels (combo-label-info x-cols y-cols viz-settings) settings (->ts-viz (first x-cols) (first y-cols) labels viz-settings)] (image-bundle/make-image-bundle diff --git a/test/metabase/pulse/render/body_test.clj b/test/metabase/pulse/render/body_test.clj index f914bdeb764802faa780dc26778c180745809dad..e7f993de2f6ad3574779060448466997ae532d2e 100644 --- a/test/metabase/pulse/render/body_test.clj +++ b/test/metabase/pulse/render/body_test.clj @@ -646,7 +646,23 @@ (testing "Multiple series with close values does not split y-axis." (is (not (axes-split? rows)))) (testing "Multiple series with far values does split y-axis." - (is (axes-split? (conj rows ["D" 3 70])))))) + (is (axes-split? (conj rows ["D" 3 70])))) + (testing "Multiple axes split does not fail when a series has the same value for all of its rows #27427" + (let [rows [["Category" "Series A" "Series B"] + ["A" 1 1.3] + ["B" 1 1.9] + ["C" 1 4]] + axes-split? (fn [rows] + (let [text (-> rows first last)] + ;; there is always 1 node with the series name in the legend + ;; so we see if the series name shows up a second time, which will + ;; be the axis label, indicating that there is indeed a split + (< 1 (-> rows + (render.tu/make-viz-data :bar {}) + :viz-tree + (render.tu/nodes-with-text text) + count))))] + (is (axes-split? rows)))))) (deftest ^:parallel x-and-y-axis-label-info-test (let [x-col {:display_name "X col"}