mirror of
https://github.com/penpot/penpot.git
synced 2025-08-04 12:58:24 +02:00
Migrate token tests to tokens-lib
This commit is contained in:
parent
bca4ea3819
commit
3681678dc4
2 changed files with 26 additions and 24 deletions
|
@ -1,16 +1,18 @@
|
|||
(ns token-tests.helpers.tokens
|
||||
(:require
|
||||
[app.common.test-helpers.ids-map :as thi]
|
||||
[app.main.ui.workspace.tokens.token :as wtt]))
|
||||
[app.main.ui.workspace.tokens.token :as wtt]
|
||||
[app.common.types.tokens-lib :as ctob]))
|
||||
|
||||
(defn add-token [state label params]
|
||||
(let [id (thi/new-id! label)
|
||||
token (assoc params :id id)]
|
||||
(update-in state [:data :tokens] assoc id token)))
|
||||
|
||||
(defn get-token [file label]
|
||||
(let [id (thi/id label)]
|
||||
(get-in file [:data :tokens id])))
|
||||
(defn get-token [file name]
|
||||
(some-> (get-in file [:data :tokens-li])
|
||||
(ctob/get-active-themes-set-tokens)
|
||||
(get name)))
|
||||
|
||||
(defn apply-token-to-shape [file shape-label token-label attributes]
|
||||
(let [first-page-id (get-in file [:data :pages 0])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue