🐛 Fix theme renaming and small refactor tokens forms validation

This commit is contained in:
Andrés Moya
2025-10-24 15:33:01 +02:00
committed by Andrés Moya
parent 1b81ddebb4
commit 70143f8ae3
7 changed files with 136 additions and 95 deletions

View File

@@ -12,15 +12,15 @@
(t/deftest test-valid-token-name-schema
;; Allow regular namespace token names
(t/is (some? (m/validate wtf/valid-token-name-schema "Foo")))
(t/is (some? (m/validate wtf/valid-token-name-schema "foo")))
(t/is (some? (m/validate wtf/valid-token-name-schema "FOO")))
(t/is (some? (m/validate wtf/valid-token-name-schema "Foo.Bar.Baz")))
(t/is (some? (m/validate wtf/well-formed-token-name-schema "Foo")))
(t/is (some? (m/validate wtf/well-formed-token-name-schema "foo")))
(t/is (some? (m/validate wtf/well-formed-token-name-schema "FOO")))
(t/is (some? (m/validate wtf/well-formed-token-name-schema "Foo.Bar.Baz")))
;; Allow trailing tokens
(t/is (nil? (m/validate wtf/valid-token-name-schema "Foo.Bar.Baz....")))
(t/is (nil? (m/validate wtf/well-formed-token-name-schema "Foo.Bar.Baz....")))
;; Disallow multiple separator dots
(t/is (nil? (m/validate wtf/valid-token-name-schema "Foo..Bar.Baz")))
(t/is (nil? (m/validate wtf/well-formed-token-name-schema "Foo..Bar.Baz")))
;; Disallow any special characters
(t/is (nil? (m/validate wtf/valid-token-name-schema "Hey Foo.Bar")))
(t/is (nil? (m/validate wtf/valid-token-name-schema "Hey😈Foo.Bar")))
(t/is (nil? (m/validate wtf/valid-token-name-schema "Hey%Foo.Bar"))))
(t/is (nil? (m/validate wtf/well-formed-token-name-schema "Hey Foo.Bar")))
(t/is (nil? (m/validate wtf/well-formed-token-name-schema "Hey😈Foo.Bar")))
(t/is (nil? (m/validate wtf/well-formed-token-name-schema "Hey%Foo.Bar"))))