mirror of
https://github.com/penpot/penpot.git
synced 2025-01-21 06:02:32 -05:00
Add predicate for all test
This commit is contained in:
parent
62ecee2cf8
commit
e75f9a7c7f
2 changed files with 6 additions and 0 deletions
|
@ -59,6 +59,11 @@
|
|||
acc applied-attrs))))
|
||||
{} shapes))
|
||||
|
||||
(defn group-shapes-by-all-applied-all? [grouped-shapes]
|
||||
(and (seq (:all grouped-shapes))
|
||||
(empty? (:other grouped-shapes))
|
||||
(empty? (:some grouped-shapes))))
|
||||
|
||||
(defn token-name->path
|
||||
"Splits token-name into a path vector split by `.` characters.
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
(let [shapes [{:applied-tokens {:x 1 :y 1}}
|
||||
{:applied-tokens {:x 1 :y 1}}]
|
||||
expected (wtt/group-shapes-by-all-applied {:id 1} shapes #{:x :y})]
|
||||
(t/is (true? (wtt/group-shapes-by-all-applied-all? expected)))
|
||||
(t/is (= (:all expected) shapes))
|
||||
(t/is (empty? (:other expected)))
|
||||
(t/is (empty? (:some expected)))))
|
||||
|
|
Loading…
Add table
Reference in a new issue