|
@@ -80,8 +80,8 @@
|
|
|
|
|
|
(testing "for user comma separated properties with mixed values"
|
|
|
(are [k v y] (= (parse-property k v {:property/separated-by-commas #{:comma-prop}}) y)
|
|
|
- :comma-prop "foo, #bar" #{"foo", "bar"}
|
|
|
- :comma-prop "comma, separated, [[page ref]], [[nested [[page]]]], #[[nested [[tag]]]], end" #{"page ref" "nested [[page]]" "nested [[tag]]" "comma" "separated" "end"}))
|
|
|
+ :comma-prop "foo, #bar" #{"foo", "bar"}
|
|
|
+ :comma-prop "comma, separated, [[page ref]], [[nested [[page]]]], #[[nested [[tag]]]], end" #{"page ref" "nested [[page]]" "nested [[tag]]" "comma" "separated" "end"}))
|
|
|
|
|
|
(testing "for normal properties"
|
|
|
(are [k v y] (= (parse-property k v {}) y)
|
|
@@ -102,10 +102,19 @@
|
|
|
(are [k v y] (= (parse-property k v {}) y)
|
|
|
:tags "\"foo, bar\"" "\"foo, bar\""
|
|
|
:tags "\"[[foo]], [[bar]]\"" "\"[[foo]], [[bar]]\""))
|
|
|
-
|
|
|
+
|
|
|
(testing "parse title property with square bracket"
|
|
|
(are [k v y] (= (parse-property k v {}) y)
|
|
|
- :title "[[Jan 11th, 2022]] 21:26" "\"[[Jan 11th, 2022]] 21:26\"")))
|
|
|
+ :title "[[Jan 11th, 2022]] 21:26" "[[Jan 11th, 2022]] 21:26"
|
|
|
+ :title "[[[[aldsfkd]] a.b/c.d]]" "[[[[aldsfkd]] a.b/c.d]]"))
|
|
|
+
|
|
|
+ (testing "built-in properties parse as expected"
|
|
|
+ (are [k v y] (= (parse-property k v {}) y)
|
|
|
+ :id "62e98716-9c0b-4253-83e7-7f8e8a23fe19" "62e98716-9c0b-4253-83e7-7f8e8a23fe19"
|
|
|
+ :filters "{\"product process\" true}" "{\"product process\" true}"
|
|
|
+ :collapsed "false" false
|
|
|
+ :created-at "1609233702047" 1609233702047
|
|
|
+ :background-color "#533e7d" "#533e7d")))
|
|
|
|
|
|
|
|
|
#_(cljs.test/test-ns 'logseq.graph-parser.text-test)
|