fix: import namespaced tag correctly

Fixes db graphs being invalid and some of
https://github.com/logseq/db-test/issues/7#issuecomment-2463162620
This commit is contained in:
Gabriel Horner
2024-11-12 14:10:06 -05:00
parent 3154b849dd
commit f1624fb20c
3 changed files with 42 additions and 29 deletions

View File

@@ -186,8 +186,8 @@
;; Counts
;; Includes journals as property values e.g. :logseq.task/deadline
(is (= 20 (count (d/q '[:find ?b :where [?b :block/type "journal"]] @conn))))
(is (= 20 (count (d/q '[:find ?b :where [?b :block/tags :logseq.class/Journal]] @conn))))
(is (= 21 (count (d/q '[:find ?b :where [?b :block/type "journal"]] @conn))))
(is (= 21 (count (d/q '[:find ?b :where [?b :block/tags :logseq.class/Journal]] @conn))))
(is (= 4 (count (d/q '[:find ?b :where [?b :block/tags :logseq.class/Task]] @conn))))
(is (= 3 (count (d/q '[:find ?b :where [?b :block/tags :logseq.class/Query]] @conn))))
@@ -481,10 +481,10 @@
(is (empty? (map :entity (:errors (db-validate/validate-db! @conn))))
"Created graph has no validation errors")
(is (= 0 (count @(:ignored-properties import-state))) "No ignored properties")
(is (= 9 (->> @conn
(d/q '[:find [?ident ...]
:where [?b :block/type "class"] [?b :db/ident ?ident] (not [?b :logseq.property/built-in?])])
count))
(is (= 11 (->> @conn
(d/q '[:find [?ident ...]
:where [?b :block/type "class"] [?b :db/ident ?ident] (not [?b :logseq.property/built-in?])])
count))
"Correct number of user classes")))
(deftest-async export-files-with-tag-classes-option