diff --git a/common/src/app/common/test_helpers/composable/shadow.cljc b/common/src/app/common/test_helpers/composable/shadow.cljc index eab19badd8..da48658bc1 100644 --- a/common/src/app/common/test_helpers/composable/shadow.cljc +++ b/common/src/app/common/test_helpers/composable/shadow.cljc @@ -764,7 +764,8 @@ (assoc-in [(:id shape) group] (merge placed (when (and root? (= :geometry-group group)) position-orientation) - (select-keys old carried))))))) + ;; an attribute the copy leaves unset carries as unset + (into {} (map #(vector % (get old %))) carried))))))) result (cond->> (dissoc groups :swap-group) ;; the head carries only its own layout item overrides (= root-id (:id shape)) diff --git a/common/test/common_tests/logic/composable_gen_test.cljc b/common/test/common_tests/logic/composable_gen_test.cljc index 9fc011cdaa..04105b17bf 100644 --- a/common/test/common_tests/logic/composable_gen_test.cljc +++ b/common/test/common_tests/logic/composable_gen_test.cljc @@ -1807,6 +1807,13 @@ :ops [[:duplicate 0 0 0 0] [:edit 2 2 0 1] [:combine 0] [:switch 0] [:update-main 0 0 0 0]]})))) +(t/deftest switching-a-copy-carries-the-constraints-it-leaves-unset + (t/is (map? (cg/run {:world [2 2 {:variants true :text-styles true :layout nil :variant-diff false + :layout-item-margins false :grid-square false :rich-variants true + :layout-children false :grid-empty false :layout-copies true :text true}] + :ops [[:variant-property 0 0 0 0] [:switch 3] [:style 25 7 1] [:combine 0] [:switch 1] + [:make-variant 19] [:switch 26]]})))) + (t/deftest random-variant-compositions (let [coverage (atom {}) failure (atom nil)]