From ab8577f957509c43967be0df12b48b05d8c80468 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 30 Mar 2026 10:52:58 +0000 Subject: [PATCH] :recycle: Update common tests for :content to :path-data rename Update path_data_test and geom_shapes_test to use :path-data instead of :content when creating and asserting on path shapes. Signed-off-by: Andrey Antukh --- common/test/common_tests/geom_shapes_test.cljc | 2 +- .../test/common_tests/types/path_data_test.cljc | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/common/test/common_tests/geom_shapes_test.cljc b/common/test/common_tests/geom_shapes_test.cljc index 29401412ec..dc81b16e9c 100644 --- a/common/test/common_tests/geom_shapes_test.cljc +++ b/common/test/common_tests/geom_shapes_test.cljc @@ -31,7 +31,7 @@ (if (= type :path) (cts/setup-shape (into {:type :path - :content (path/content (:content params default-path))} + :path-data (path/content (:path-data params default-path))} params)) (cts/setup-shape (into {:type type diff --git a/common/test/common_tests/types/path_data_test.cljc b/common/test/common_tests/types/path_data_test.cljc index d1a70707b2..3bcb68ff54 100644 --- a/common/test/common_tests/types/path_data_test.cljc +++ b/common/test/common_tests/types/path_data_test.cljc @@ -1118,11 +1118,11 @@ (t/deftest path-shape-with-open-path? (t/testing "path shape with open content is open" (let [shape {:type :path - :content (path/content simple-open-content)}] + :path-data (path/content simple-open-content)}] (t/is (path/shape-with-open-path? shape)))) (t/testing "path shape with closed content is not open" (let [shape {:type :path - :content (path/content simple-closed-content)}] + :path-data (path/content simple-closed-content)}] (t/is (not (path/shape-with-open-path? shape)))))) (t/deftest path-get-byte-size @@ -1199,22 +1199,22 @@ :selrect (make-selrect 0.0 0.0 100.0 50.0)} result (path/convert-to-path shape {})] (t/is (= :path (:type result))) - (t/is (path/content? (:content result))) + (t/is (path/content? (:path-data result))) ;; A simple rect (no radius) produces an empty path in the current impl ;; so we just check it doesn't throw and returns a :path type - (t/is (some? (:content result))))) + (t/is (some? (:path-data result))))) (t/deftest shape-to-path-circle (let [shape {:type :circle :x 0.0 :y 0.0 :width 100.0 :height 100.0 :selrect (make-selrect 0.0 0.0 100.0 100.0)} result (path/convert-to-path shape {})] (t/is (= :path (:type result))) - (t/is (path/content? (:content result))) + (t/is (path/content? (:path-data result))) ;; A circle converts to bezier curves — should have multiple segments - (t/is (> (count (vec (:content result))) 1)))) + (t/is (> (count (vec (:path-data result))) 1)))) (t/deftest shape-to-path-path - (let [shape {:type :path :content (path/content sample-content)} + (let [shape {:type :path :path-data (path/content sample-content)} result (path/convert-to-path shape {})] ;; A path shape stays a path shape unchanged (t/is (= :path (:type result))))) @@ -1226,6 +1226,6 @@ result (path/convert-to-path shape {})] (t/is (= :path (:type result))) ;; rounded rect should have curve-to segments - (let [segs (vec (:content result)) + (let [segs (vec (:path-data result)) curve-segs (filter #(= :curve-to (:command %)) segs)] (t/is (pos? (count curve-segs))))))