mirror of
https://github.com/penpot/penpot.git
synced 2025-08-04 06:28:25 +02:00
♻️ Refactor variants
* ♻️ Refactor variants * ✨ Add MR changes
This commit is contained in:
parent
d1d30e7eb5
commit
9653e72e47
17 changed files with 496 additions and 252 deletions
|
@ -7,7 +7,7 @@
|
|||
(ns common-tests.logic.variants-test
|
||||
(:require
|
||||
[app.common.files.changes-builder :as pcb]
|
||||
[app.common.logic.variants :as clv]
|
||||
[app.common.logic.variant-properties :as clvp]
|
||||
[app.common.test-helpers.components :as thc]
|
||||
[app.common.test-helpers.files :as thf]
|
||||
[app.common.test-helpers.ids-map :as thi]
|
||||
|
@ -20,7 +20,7 @@
|
|||
(t/deftest test-update-property-name
|
||||
(let [;; ==== Setup
|
||||
file (-> (thf/sample-file :file1)
|
||||
(thv/add-variant :v01 :c01 :m01 :c02 :m02))
|
||||
(thv/add-variant-two-properties :v01 :c01 :m01 :c02 :m02))
|
||||
v-id (-> (ths/get-shape file :v01) :id)
|
||||
page (thf/current-page file)
|
||||
|
||||
|
@ -29,8 +29,8 @@
|
|||
(pcb/with-page-id (:id page))
|
||||
(pcb/with-library-data (:data file))
|
||||
(pcb/with-objects (:objects page))
|
||||
(clv/generate-update-property-name v-id 0 "NewName1")
|
||||
(clv/generate-update-property-name v-id 1 "NewName2"))
|
||||
(clvp/generate-update-property-name v-id 0 "NewName1")
|
||||
(clvp/generate-update-property-name v-id 1 "NewName2"))
|
||||
|
||||
|
||||
file' (thf/apply-changes file changes)
|
||||
|
@ -65,7 +65,7 @@
|
|||
(pcb/with-page-id (:id page))
|
||||
(pcb/with-library-data (:data file))
|
||||
(pcb/with-objects (:objects page))
|
||||
(clv/generate-add-new-property v-id))
|
||||
(clvp/generate-add-new-property v-id))
|
||||
|
||||
|
||||
file' (thf/apply-changes file changes)
|
||||
|
@ -101,7 +101,7 @@
|
|||
(pcb/with-page-id (:id page))
|
||||
(pcb/with-library-data (:data file))
|
||||
(pcb/with-objects (:objects page))
|
||||
(clv/generate-add-new-property v-id {:fill-values? true}))
|
||||
(clvp/generate-add-new-property v-id {:fill-values? true}))
|
||||
|
||||
|
||||
file' (thf/apply-changes file changes)
|
||||
|
@ -132,7 +132,7 @@
|
|||
(pcb/with-page-id (:id page))
|
||||
(pcb/with-library-data (:data file))
|
||||
(pcb/with-objects (:objects page))
|
||||
(clv/generate-add-new-property v-id))
|
||||
(clvp/generate-add-new-property v-id))
|
||||
|
||||
|
||||
file (thf/apply-changes file changes)
|
||||
|
@ -147,7 +147,7 @@
|
|||
(pcb/with-page-id (:id page))
|
||||
(pcb/with-library-data (:data file))
|
||||
(pcb/with-objects (:objects page))
|
||||
(clv/generate-remove-property v-id 0))
|
||||
(clvp/generate-remove-property v-id 0))
|
||||
|
||||
|
||||
file' (thf/apply-changes file changes)
|
||||
|
@ -180,8 +180,8 @@
|
|||
(pcb/with-page-id (:id page))
|
||||
(pcb/with-library-data (:data file))
|
||||
(pcb/with-objects (:objects page))
|
||||
(clv/generate-update-property-value (:id comp01) 0 "NewValue1")
|
||||
(clv/generate-update-property-value (:id comp02) 0 "NewValue2"))
|
||||
(clvp/generate-update-property-value (:id comp01) 0 "NewValue1")
|
||||
(clvp/generate-update-property-value (:id comp02) 0 "NewValue2"))
|
||||
|
||||
file' (thf/apply-changes file changes)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue