mirror of
https://github.com/penpot/penpot.git
synced 2025-06-03 01:21:37 +02:00
🎉 Scaffolding to write unit tests of common types
This commit is contained in:
parent
165cdd871f
commit
54e0071c9c
35 changed files with 724 additions and 228 deletions
|
@ -9,6 +9,7 @@
|
|||
[app.common.geom.shapes :as gsh]
|
||||
[app.common.pages :as cp]
|
||||
[app.common.pages.helpers :as cph]
|
||||
[app.common.types.shape :as cts]
|
||||
[app.main.data.workspace :as dw]
|
||||
[app.main.data.workspace.groups :as dwg]
|
||||
[app.main.data.workspace.layout :as layout]
|
||||
|
@ -69,9 +70,7 @@
|
|||
([state label type props]
|
||||
(let [page (current-page state)
|
||||
frame (cph/get-frame (:objects page))
|
||||
shape (-> (cp/make-minimal-shape type)
|
||||
(cp/setup-shape {:x 0 :y 0 :width 1 :height 1})
|
||||
(merge props))]
|
||||
shape (cts/make-shape type {:x 0 :y 0 :width 1 :height 1} props)]
|
||||
(swap! idmap assoc label (:id shape))
|
||||
(update state :workspace-data
|
||||
cp/process-changes
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue