diff --git a/common/src/app/common/test_helpers/composable/oracle.cljc b/common/src/app/common/test_helpers/composable/oracle.cljc index b8e3ad4a5b..464bc78e7f 100644 --- a/common/src/app/common/test_helpers/composable/oracle.cljc +++ b/common/src/app/common/test_helpers/composable/oracle.cljc @@ -259,6 +259,11 @@ (as-> snapshot (cond-> (dissoc snapshot :transform :transform-inverse) (#{:fill :auto} (:layout-item-h-sizing shape)) (dissoc :width) (#{:fill :auto} (:layout-item-v-sizing shape)) (dissoc :height)))) + ;; a bool shows its segments; its transform and the order of + ;; its corners say nothing its flags and segments do not + (cond-> (= :bool (:type shape)) + (-> (dissoc :transform :transform-inverse) + (d/update-when :points geom/ordered-corners))) ;; no fills or strokes show as an empty list or none at all (update :fills #(or % [])) (update :strokes #(or % [])) diff --git a/common/test/common_tests/logic/composable_gen_test.cljc b/common/test/common_tests/logic/composable_gen_test.cljc index 27995cf474..751e95b06b 100644 --- a/common/test/common_tests/logic/composable_gen_test.cljc +++ b/common/test/common_tests/logic/composable_gen_test.cljc @@ -4338,3 +4338,11 @@ (t/is (map? (cg/run {:world [2 0 {:variants true :rich-variants true :text true :layout :grid :layout-copies false :layout-children false}] :ops [[:duplicate] [:structure 0 4] [:swap 7] [:rotate 11] [:transform 1 11 0 12]]})))) + +(t/deftest generated-a-bool-in-a-flipped-board-shows-its-segments + ;; a turned bool in a flipped board may store a transform that does not + ;; mirror, while its flags and segments show it as its board turns it + (t/is (map? (cg/run {:world [2 1 {:variants true :rich-variants true :text true :layout nil + :layout-copies true :layout-children false}] + :ops [[:remove-child 0 0 0 0] [:add-child 1] [:structure 0 4 0] [:transform 0 16 0 3] + [:rotate 0 0 0 0] [:rotate 1 0 0 0]]}))))