♻️ Create hidden theme on token lib creation (#5991)

* ♻️ Create hidden theme on token lib creation

* 📎 Fix tests

* 🎉 Add migration

* 🎉 Remove comment

* ♻️ Remove unused changes

* 📎 Remove unused fn
This commit is contained in:
Eva Marco 2025-03-07 13:17:36 +01:00 committed by GitHub
parent 97fb1e00c2
commit e729e85c42
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 70 additions and 93 deletions

View file

@ -32,7 +32,6 @@
(t/is (= #{} (:sets (ctob/get-hidden-theme redo-lib))))
;; Undo
(t/is (nil? (ctob/get-hidden-theme undo-lib)))
(t/is (= #{"/theme"} (ctob/get-active-theme-paths undo-lib)))))
(t/testing "toggling an inactive set will switch to hidden theme without user sets"
@ -51,7 +50,6 @@
(t/is (= #{} (:sets (ctob/get-hidden-theme redo-lib))))
;; Undo
(t/is (nil? (ctob/get-hidden-theme undo-lib)))
(t/is (= #{"/theme"} (ctob/get-active-theme-paths undo-lib)))))
(t/testing "toggling an set with hidden theme already active will toggle set in hidden theme"
@ -68,10 +66,7 @@
undo-lib (tht/get-tokens-lib undo)]
(t/is (= (ctob/get-active-theme-paths redo-lib) (ctob/get-active-theme-paths undo-lib)))
(t/is (= #{"foo/bar"} (:sets (ctob/get-hidden-theme redo-lib))))
;; Undo
(t/is (some? (ctob/get-hidden-theme undo-lib))))))
(t/is (= #{"foo/bar"} (:sets (ctob/get-hidden-theme redo-lib)))))))
(t/deftest set-token-test
(t/testing "delete token"
@ -155,7 +150,6 @@
(t/is (= #{"foo/bar/baz" "foo/bar/baz/baz-child"} (:sets (ctob/get-hidden-theme redo-lib))))
;; Undo
(t/is (nil? (ctob/get-hidden-theme undo-lib)))
(t/is (= #{"/theme"} (ctob/get-active-theme-paths undo-lib)))))
(t/testing "toggling set group with partially active sets inside will deactivate all child sets"
@ -177,7 +171,6 @@
(t/is (= #{ctob/hidden-token-theme-path} (ctob/get-active-theme-paths redo-lib)))
;; Undo
(t/is (nil? (ctob/get-hidden-theme undo-lib)))
(t/is (= #{"/theme"} (ctob/get-active-theme-paths undo-lib))))))
(t/deftest generate-move-token-set-test