🐛 Fix reversed get args in convert-dtcg-shadow-composite

\`(get "type" shadow)\` always returns nil because the map and key
arguments were swapped. The correct call is \`(get shadow "type")\`,
which allows the legacy innerShadow detection to work correctly.
Update the test expectation accordingly.

Signed-off-by: Andrey Antukh <niwi@niwi.nz>
This commit is contained in:
Andrey Antukh 2026-04-14 12:34:38 +00:00
parent c30c85ff07
commit 8253738f01
2 changed files with 2 additions and 2 deletions

View File

@ -1637,7 +1637,7 @@ Will return a value that matches this schema:
[value] [value]
(let [process-shadow (fn [shadow] (let [process-shadow (fn [shadow]
(if (map? shadow) (if (map? shadow)
(let [legacy-shadow-type (get "type" shadow)] (let [legacy-shadow-type (get shadow "type")]
(-> shadow (-> shadow
(set/rename-keys {"x" :offset-x (set/rename-keys {"x" :offset-x
"offsetX" :offset-x "offsetX" :offset-x

View File

@ -1918,7 +1918,7 @@
(let [token (ctob/get-token-by-name lib "shadow-test" "test.shadow-with-type")] (let [token (ctob/get-token-by-name lib "shadow-test" "test.shadow-with-type")]
(t/is (some? token)) (t/is (some? token))
(t/is (= :shadow (:type token))) (t/is (= :shadow (:type token)))
(t/is (= [{:offset-x "0", :offset-y "4px", :blur "8px", :spread "0", :color "rgba(0,0,0,0.2)", :inset false}] (t/is (= [{:offset-x "0", :offset-y "4px", :blur "8px", :spread "0", :color "rgba(0,0,0,0.2)", :inset true}]
(:value token))))) (:value token)))))
(t/testing "shadow token with description" (t/testing "shadow token with description"