diff --git a/frontend/test/token_tests/logic/token_actions_test.cljs b/frontend/test/token_tests/logic/token_actions_test.cljs index b2f482728..18c105213 100644 --- a/frontend/test/token_tests/logic/token_actions_test.cljs +++ b/frontend/test/token_tests/logic/token_actions_test.cljs @@ -8,7 +8,8 @@ [cljs.test :as t :include-macros true] [frontend-tests.helpers.pages :as thp] [frontend-tests.helpers.state :as ths] - [token-tests.helpers.state :as tohs])) + [token-tests.helpers.state :as tohs] + [app.main.ui.workspace.tokens.token :as wtt])) (t/use-fixtures :each {:before thp/reset-idmap!}) @@ -36,6 +37,17 @@ {(:id radius-token) radius-token (:id radius-ref-token) radius-ref-token}) +(defn apply-token-to-shape [file shape-label token-label attributes] + (let [first-page-id (get-in file [:data :pages 0]) + shape-id (thi/id shape-label) + token-id (thi/id token-label) + applied-attributes (wtt/attributes-map attributes token-id)] + (update-in file [:data + :pages-index first-page-id + :objects shape-id + :applied-tokens] + merge applied-attributes))) + (defn- setup-file [] (-> (cthf/sample-file :file-1 :page-label :page-1)