Migrate token tests to tokens-lib

This commit is contained in:
Florian Schroedl 2024-10-01 14:40:05 +02:00
parent bca4ea3819
commit 3681678dc4
2 changed files with 26 additions and 24 deletions

View file

@ -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])