diff --git a/common/src/app/common/types/tokens_lib.cljc b/common/src/app/common/types/tokens_lib.cljc index 7495ccac25..484d9c81df 100644 --- a/common/src/app/common/types/tokens_lib.cljc +++ b/common/src/app/common/types/tokens_lib.cljc @@ -882,9 +882,10 @@ Will return a value that matches this schema: (map :name) (into #{})) difference (set/difference path-active-set-names active-set-names)] - (if (empty? difference) - :all - :partial)) + (cond + (empty? difference) :all + (seq (set/intersection path-active-set-names active-set-names)) :partial + :else :none)) :none))) (get-active-themes-set-tokens [this] diff --git a/common/test/common_tests/types/tokens_lib_test.cljc b/common/test/common_tests/types/tokens_lib_test.cljc index 96f1247725..f11829d98e 100644 --- a/common/test/common_tests/types/tokens_lib_test.cljc +++ b/common/test/common_tests/types/tokens_lib_test.cljc @@ -412,7 +412,9 @@ :sets #{"foo/bar/baz"})) (ctob/add-theme (ctob/make-token-theme :name "all" :sets #{"foo/bar/baz" - "foo/bar/bam"}))) + "foo/bar/bam"})) + (ctob/add-theme (ctob/make-token-theme :name "invalid" + :sets #{"foo/missing"}))) expected-none (-> tokens-lib (ctob/set-active-themes #{"/none"}) @@ -422,10 +424,14 @@ (ctob/sets-at-path-all-active? "G-foo")) expected-partial (-> tokens-lib (ctob/set-active-themes #{"/partial"}) - (ctob/sets-at-path-all-active? "G-foo"))] + (ctob/sets-at-path-all-active? "G-foo")) + expected-invalid-none (-> tokens-lib + (ctob/set-active-themes #{"/invalid"}) + (ctob/sets-at-path-all-active? "G-foo"))] (t/is (= :none expected-none)) (t/is (= :all expected-all)) - (t/is (= :partial expected-partial))))) + (t/is (= :partial expected-partial)) + (t/is (= :none expected-invalid-none))))) (t/deftest token-theme-in-a-lib (t/testing "add-token-theme"