diff --git a/common/src/app/common/test_helpers/composable/shadow.cljc b/common/src/app/common/test_helpers/composable/shadow.cljc index aaf0ef7855..500800e62e 100644 --- a/common/src/app/common/test_helpers/composable/shadow.cljc +++ b/common/src/app/common/test_helpers/composable/shadow.cljc @@ -663,9 +663,12 @@ (not (contains? text-differences unit))) unit))) text-groups) - mixed-typography? (some #(not= (contains? carried-text-units :typography) - (contains? carried-text-units %)) - [:family :weight :size :line-height :spacing :case])] + ;; a typography the copy applied carries only with all its styles + mixed-typography? (and (some #(or (:typography-ref-id %) (:typography-ref-file %)) + (tree-seq map? :children (:content old))) + (some #(not= (contains? carried-text-units :typography) + (contains? carried-text-units %)) + [:family :weight :size :line-height :spacing :case]))] (reduce-kv (fn [result group _] (if-let [unit (get text-groups group)] diff --git a/common/test/common_tests/logic/composable_gen_test.cljc b/common/test/common_tests/logic/composable_gen_test.cljc index e14db90912..0dadd8cfda 100644 --- a/common/test/common_tests/logic/composable_gen_test.cljc +++ b/common/test/common_tests/logic/composable_gen_test.cljc @@ -1700,6 +1700,14 @@ :ops [[:add-variant 0] [:switch 0] [:add-variant 0 0 0 0] [:delete 2 0 0 0] [:add-variant 0 0 0 0]]})))) +(t/deftest switching-a-copy-text-without-the-mains-typography-keeps-that-override + (t/is (map? (cg/run {:world [3 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 [[:add-variant 0] [:switch 5] [:delete 25 0 0 0] [:text-style 12 8 1] + [:text 26 3 0 0] [:add-variant 2] [:switch 0] [:variant-property 0 0 0 0] + [:switch 20]]})))) + (t/deftest random-variant-compositions (let [coverage (atom {}) failure (atom nil)]