🎉 Add id to token theme (#6044)

* 🎉 Add id to token theme

* 📎 Fix tests

* 📎 Fixes from review
This commit is contained in:
Eva Marco 2025-03-10 18:38:52 +01:00 committed by GitHub
parent 46c89a1bcf
commit 0c3fd8a6d9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 35 additions and 4 deletions

View file

@ -1257,6 +1257,7 @@
:value "{accent.default}"})}))
(ctob/add-theme (ctob/make-token-theme :name "theme-1"
:group "group-1"
:id "test-id-00"
:modified-at now
:sets #{"core"})))
result (ctob/encode-dtcg tokens-lib)
@ -1264,6 +1265,7 @@
"group" "group-1"
"is-source" false
"modified-at" now
"id" "test-id-00"
"name" "theme-1"
"selectedTokenSets" {"core" "enabled"}}]
"$metadata" {"tokenSetOrder" ["core"]
@ -1304,6 +1306,7 @@
{:name "button.primary.background"
:type :color
:value "{accent.default}"})})))
encoded (ctob/encode-dtcg tokens-lib)
with-prev-tokens-lib (ctob/decode-dtcg-json tokens-lib encoded)
with-empty-tokens-lib (ctob/decode-dtcg-json (ctob/ensure-tokens-lib nil) encoded)]
@ -1374,6 +1377,7 @@
:value "{accent.default}"})}))
(ctob/add-theme (ctob/make-token-theme :name "theme-1"
:group "group-1"
:id "test-id-01"
:modified-at now
:sets #{"core"}))
(ctob/toggle-theme-active? "group-1" "theme-1"))
@ -1382,6 +1386,7 @@
"group" "group-1"
"is-source" false
"modified-at" now
"id" "test-id-01"
"name" "theme-1"
"selectedTokenSets" {"core" "enabled"}}]
"$metadata" {"tokenSetOrder" ["core"]