0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-01 11:59:17 -05:00

Fix sizing test

This commit is contained in:
Florian Schroedl 2024-08-08 15:13:04 +02:00
parent 8b8b909fb7
commit e992bf0aa6

View file

@ -147,33 +147,33 @@
(t/is (= (:width rect-1') 100)) (t/is (= (:width rect-1') 100))
(t/is (= (:height rect-1') 100)))))))))) (t/is (= (:height rect-1') 100))))))))))
;; (t/deftest test-apply-sizing (t/deftest test-apply-sizing
;; (t/testing "applies sizing token and updates the shapes width and height" (t/testing "applies sizing token and updates the shapes width and height"
;; (t/async (t/async
;; done done
;; (let [file (-> (setup-file) (let [file (-> (setup-file)
;; (toht/add-token :token-target {:value "100" (toht/add-token :token-target {:value "100"
;; :name "sizing.sm" :name "sizing.sm"
;; :type :sizing})) :type :sizing}))
;; store (ths/setup-store file) store (ths/setup-store file)
;; rect-1 (cths/get-shape file :rect-1) rect-1 (cths/get-shape file :rect-1)
;; events [(wtch/apply-token {:shape-ids [(:id rect-1)] events [(wtch/apply-token {:shape-ids [(:id rect-1)]
;; :attributes #{:width :height} :attributes #{:width :height}
;; :token (toht/get-token file :token-target) :token (toht/get-token file :token-target)
;; :on-update-shape wtch/update-shape-dimensions})]] :on-update-shape wtch/update-shape-dimensions})]]
;; (tohs/run-store-async (tohs/run-store-async
;; store done events store done events
;; (fn [new-state] (fn [new-state]
;; (let [file' (ths/get-file-from-store new-state) (let [file' (ths/get-file-from-store new-state)
;; token-target' (toht/get-token file' :token-target) token-target' (toht/get-token file' :token-target)
;; rect-1' (cths/get-shape file' :rect-1)] rect-1' (cths/get-shape file' :rect-1)]
;; (t/testing "shape `:applied-tokens` got updated" (t/testing "shape `:applied-tokens` got updated"
;; (t/is (some? (:applied-tokens rect-1'))) (t/is (some? (:applied-tokens rect-1')))
;; (t/is (= (:width (:applied-tokens rect-1')) (wtt/token-identifier token-target'))) (t/is (= (:width (:applied-tokens rect-1')) (wtt/token-identifier token-target')))
;; (t/is (= (:height (:applied-tokens rect-1')) (wtt/token-identifier token-target')))) (t/is (= (:height (:applied-tokens rect-1')) (wtt/token-identifier token-target'))))
;; (t/testing "shapes width and height got updated" (t/testing "shapes width and height got updated"
;; (t/is (= (:width rect-1') 100)) (t/is (= (:width rect-1') 100))
;; (t/is (= (:height rect-1') 100)))))))))) (t/is (= (:height rect-1') 100))))))))))
(t/deftest test-apply-opacity (t/deftest test-apply-opacity
(t/testing "applies opacity token and updates the shapes opacity" (t/testing "applies opacity token and updates the shapes opacity"