mirror of
https://github.com/penpot/penpot.git
synced 2025-01-21 22:22:43 -05:00
Add active-themes to data serialization tests
This commit is contained in:
parent
f2569a1c4a
commit
d7d974242e
1 changed files with 8 additions and 4 deletions
|
@ -448,13 +448,15 @@
|
||||||
:type :boolean
|
:type :boolean
|
||||||
:value true))
|
:value true))
|
||||||
(ctob/add-theme (ctob/make-token-theme :name "test-token-theme"))
|
(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)
|
encoded-str (tr/encode-str tokens-lib)
|
||||||
tokens-lib' (tr/decode-str encoded-str)]
|
tokens-lib' (tr/decode-str encoded-str)]
|
||||||
|
|
||||||
(t/is (ctob/valid-tokens-lib? tokens-lib'))
|
(t/is (ctob/valid-tokens-lib? tokens-lib'))
|
||||||
(t/is (= (ctob/set-count tokens-lib') 1))
|
(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
|
(t/deftest fressian-serialization
|
||||||
(let [tokens-lib (-> (ctob/make-tokens-lib)
|
(let [tokens-lib (-> (ctob/make-tokens-lib)
|
||||||
|
@ -463,13 +465,15 @@
|
||||||
:type :boolean
|
:type :boolean
|
||||||
:value true))
|
:value true))
|
||||||
(ctob/add-theme (ctob/make-token-theme :name "test-token-theme"))
|
(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)
|
encoded-blob (fres/encode tokens-lib)
|
||||||
tokens-lib' (fres/decode encoded-blob)]
|
tokens-lib' (fres/decode encoded-blob)]
|
||||||
|
|
||||||
(t/is (ctob/valid-tokens-lib? tokens-lib'))
|
(t/is (ctob/valid-tokens-lib? tokens-lib'))
|
||||||
(t/is (= (ctob/set-count tokens-lib') 1))
|
(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"
|
(t/testing "grouping"
|
||||||
|
|
Loading…
Add table
Reference in a new issue