0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-21 06:02:32 -05:00

Add active-themes to data serialization tests

This commit is contained in:
Florian Schroedl 2024-09-24 11:18:12 +02:00
parent f2569a1c4a
commit d7d974242e

View file

@ -448,13 +448,15 @@
:type :boolean
:value true))
(ctob/add-theme (ctob/make-token-theme :name "test-token-theme"))
(ctob/toggle-set-in-theme "" "test-token-theme" "test-token-set"))
(ctob/toggle-set-in-theme "" "test-token-theme" "test-token-set")
(ctob/activate-theme "" "test-token-theme"))
encoded-str (tr/encode-str tokens-lib)
tokens-lib' (tr/decode-str encoded-str)]
(t/is (ctob/valid-tokens-lib? tokens-lib'))
(t/is (= (ctob/set-count tokens-lib') 1))
(t/is (= (ctob/theme-count tokens-lib') 1))))
(t/is (= (ctob/theme-count tokens-lib') 1))
(t/is (= (ctob/get-active-theme-paths tokens-lib') #{"/test-token-theme"}))))
(t/deftest fressian-serialization
(let [tokens-lib (-> (ctob/make-tokens-lib)
@ -463,13 +465,15 @@
:type :boolean
:value true))
(ctob/add-theme (ctob/make-token-theme :name "test-token-theme"))
(ctob/toggle-set-in-theme "" "test-token-theme" "test-token-set"))
(ctob/toggle-set-in-theme "" "test-token-theme" "test-token-set")
(ctob/activate-theme "" "test-token-theme"))
encoded-blob (fres/encode tokens-lib)
tokens-lib' (fres/decode encoded-blob)]
(t/is (ctob/valid-tokens-lib? tokens-lib'))
(t/is (= (ctob/set-count tokens-lib') 1))
(t/is (= (ctob/theme-count tokens-lib') 1)))))
(t/is (= (ctob/theme-count tokens-lib') 1))
(t/is (= (ctob/get-active-theme-paths tokens-lib') #{"/test-token-theme"})))))
(t/testing "grouping"