fix: import doesn't fail if it has a page with new class name

fixes LOG-3039
This commit is contained in:
Gabriel Horner
2024-08-08 14:48:56 -04:00
parent 1f0bac9343
commit 4a69e75e88
4 changed files with 21 additions and 7 deletions

View File

@@ -170,7 +170,7 @@
(is (= 18 (count (d/q '[:find ?b :where [?b :block/type "journal"]] @conn))))
;; Don't count pages like url.md that have properties but no content
(is (= 6
(is (= 7
(count (->> (d/q '[:find [(pull ?b [:block/title :block/type]) ...]
:where [?b :block/title] [_ :block/page ?b]] @conn)
(filter #(= "page" (:block/type %))))))
@@ -346,6 +346,14 @@
count))
"A block with different case of same ref names has 1 distinct ref"))
(testing "imported concepts can have names of new-built concepts"
(is (= #{:logseq.property/description :user.property/description}
(set (d/q '[:find [?ident ...] :where [?b :db/ident ?ident] [?b :block/name "description"]] @conn)))
"user description property is separate from built-in one")
(is (= #{"page" "class"}
(set (d/q '[:find [?type ...] :where [?b :block/type ?type] [?b :block/name "task"]] @conn)))
"user page is separate from built-in class"))
(testing "multiline blocks"
(is (= "|markdown| table|\n|some|thing|" (:block/title (find-block-by-content @conn #"markdown.*table"))))
(is (= "multiline block\na 2nd\nand a 3rd" (:block/title (find-block-by-content @conn #"multiline block"))))