mirror of
https://github.com/penpot/penpot.git
synced 2025-08-03 16:49:16 +02:00
🐛 Fix token file import of Figma generated file (#5591)
* 🐛 Fix token sets selection representation in exported theme * 🐛 Fix the loss of token set order * 🐛 Change data shape according to internal representaion * 🐛 Persist sets order on import according to metadata * 🐛 Add fallback for nil values * 🐛 Fix test assertions accoding to the exported json format * 🐛 Make `:is-source` optional * ♻️ Fix test description * ♻️ Remove outdated comment
This commit is contained in:
parent
cf82e42125
commit
5793c526c0
4 changed files with 51 additions and 27 deletions
|
@ -32,9 +32,10 @@
|
|||
(t/deftest process-json-stream-test
|
||||
(t/async
|
||||
done
|
||||
(t/testing "processes empty json string"
|
||||
(t/testing "process simple color token value"
|
||||
(let [json (-> {"core" {"color" {"$value" "red"
|
||||
"$type" "color"}}}
|
||||
"$type" "color"}}
|
||||
"$metadata" {"tokenSetOrder" ["core"]}}
|
||||
(tr/encode-str {:type :json-verbose}))]
|
||||
(->> (rx/of json)
|
||||
(sd/process-json-stream)
|
||||
|
@ -103,7 +104,8 @@ color.value tries to reference missing, which is not defined.")))
|
|||
done
|
||||
(t/testing "fails on missing references in tokens"
|
||||
(let [json (-> {"core" {"color" {"$value" "{missing}"
|
||||
"$type" "color"}}}
|
||||
"$type" "color"}}
|
||||
"$metadata" {"tokenSetOrder" ["core"]}}
|
||||
(tr/encode-str {:type :json-verbose}))]
|
||||
(->> (rx/of json)
|
||||
(sd/process-json-stream)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue