diff --git a/common/src/app/common/logic/variant_properties.cljc b/common/src/app/common/logic/variant_properties.cljc index 8bdda182e1..c7c58e8677 100644 --- a/common/src/app/common/logic/variant_properties.cljc +++ b/common/src/app/common/logic/variant_properties.cljc @@ -42,11 +42,11 @@ changes related-components) - ids-to-validate (map :main-instance-id related-components) - + ;; All components of the variant change, so validate the + ;; container, which also checks every main instance changes (pcb/validate-shapes changes (pcb/get-page-id changes) - ids-to-validate + [variant-id] (str "generate-update-property-name: " variant-id " pos: " pos " new-name: " new-name))] changes))))))) @@ -74,11 +74,11 @@ changes related-components) - ids-to-validate (map :main-instance-id related-components) - + ;; All components of the variant change, so validate the + ;; container, which also checks every main instance changes (pcb/validate-shapes changes (pcb/get-page-id changes) - ids-to-validate + [variant-id] (str "generate-remove-property: " variant-id " pos: " pos))] changes) changes)))) diff --git a/common/test/common_tests/logic/variant_properties_test.cljc b/common/test/common_tests/logic/variant_properties_test.cljc index be7a83c411..d300f77349 100644 --- a/common/test/common_tests/logic/variant_properties_test.cljc +++ b/common/test/common_tests/logic/variant_properties_test.cljc @@ -79,7 +79,8 @@ (t/is (= (-> comp01' :variant-properties first :name) "NewName1")) (t/is (= (-> comp01' :variant-properties last :name) "NewName2")) (t/is (= (-> comp02' :variant-properties first :name) "NewName1")) - (t/is (= (-> comp02' :variant-properties last :name) "NewName2")))) + (t/is (= (-> comp02' :variant-properties last :name) "NewName2")) + (t/is (thf/validates-shapes-last? changes (:id page) [v-id])))) (t/deftest test-update-property-name-duplicate (let [file (-> (thf/sample-file :file1) @@ -188,7 +189,8 @@ (t/is (= (count (:variant-properties comp01')) 1)) (t/is (= (count (:variant-properties comp02)) 2)) (t/is (= (count (:variant-properties comp02')) 1)) - (t/is (= (-> comp01' :variant-properties first :name) "Property 2")))) + (t/is (= (-> comp01' :variant-properties first :name) "Property 2")) + (t/is (thf/validates-shapes-last? changes (:id page) [v-id])))) ;; ============================================================================= ;; generate-update-property-value tests