mirror of
https://github.com/penpot/penpot.git
synced 2025-08-02 18:58:37 +02:00
Restore apply-tokens test
This commit is contained in:
parent
eceffda095
commit
1df40ea07a
3 changed files with 39 additions and 35 deletions
|
@ -1,5 +1,6 @@
|
|||
(ns token-tests.helpers.state
|
||||
(:require
|
||||
[app.common.types.tokens-lib :as ctob]
|
||||
[app.main.ui.workspace.tokens.style-dictionary :as sd]
|
||||
[beicon.v2.core :as rx]
|
||||
[potok.v2.core :as ptk]))
|
||||
|
@ -21,11 +22,10 @@
|
|||
(ptk/reify ::end+
|
||||
ptk/WatchEvent
|
||||
(watch [_ state _]
|
||||
(->> (rx/from (sd/resolve-tokens+ (get-in state [:workspace-data :tokens])))
|
||||
(rx/mapcat
|
||||
(fn [_]
|
||||
(rx/of
|
||||
(end))))))))
|
||||
(->> (rx/from (-> (get-in state [:workspace-data :tokens-lib])
|
||||
(ctob/get-active-themes-set-tokens)
|
||||
(sd/resolve-tokens+ {:names-map? true})))
|
||||
(rx/mapcat #(rx/of (end)))))))
|
||||
|
||||
(defn stop-on
|
||||
"Helper function to be used with async version of run-store.
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
(update-in state [:data :tokens] assoc id token)))
|
||||
|
||||
(defn get-token [file name]
|
||||
(some-> (get-in file [:data :tokens-li])
|
||||
(some-> (get-in file [:data :tokens-lib])
|
||||
(ctob/get-active-themes-set-tokens)
|
||||
(get name)))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue