mirror of
https://github.com/penpot/penpot.git
synced 2025-12-11 22:14:05 +01:00
Add predicate for all test
This commit is contained in:
@@ -59,6 +59,11 @@
|
|||||||
acc applied-attrs))))
|
acc applied-attrs))))
|
||||||
{} shapes))
|
{} 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
|
(defn token-name->path
|
||||||
"Splits token-name into a path vector split by `.` characters.
|
"Splits token-name into a path vector split by `.` characters.
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
(let [shapes [{:applied-tokens {:x 1 :y 1}}
|
(let [shapes [{:applied-tokens {:x 1 :y 1}}
|
||||||
{:applied-tokens {:x 1 :y 1}}]
|
{:applied-tokens {:x 1 :y 1}}]
|
||||||
expected (wtt/group-shapes-by-all-applied {:id 1} shapes #{:x :y})]
|
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 (= (:all expected) shapes))
|
||||||
(t/is (empty? (:other expected)))
|
(t/is (empty? (:other expected)))
|
||||||
(t/is (empty? (:some expected)))))
|
(t/is (empty? (:some expected)))))
|
||||||
|
|||||||
Reference in New Issue
Block a user