fix: frontend and graph-parser tests and lints

Removed file specific test
This commit is contained in:
Gabriel Horner
2025-12-30 22:10:27 -05:00
parent 2bcc331916
commit 20cbb626a0
4 changed files with 9 additions and 18 deletions

View File

@@ -21,3 +21,7 @@ logseq.graph-parser.text/get-page-name
logseq.graph-parser.text/get-namespace-last-part
;; API
logseq.graph-parser.whiteboard/shape->block
;; API
logseq.graph-parser/parse-file
;; API
logseq.graph-parser/filter-files

View File

@@ -76,7 +76,6 @@
(def file-graph-paths
"Paths _only_ for file graphs"
["deps/db/src/logseq/db/file_based"
"deps/graph-parser/src/logseq/graph_parser/db.cljs"
"deps/graph-parser/src/logseq/graph_parser/extract.cljc"
"deps/graph-parser/src/logseq/graph_parser/property.cljs"
"deps/graph-parser/src/logseq/graph_parser.cljs"

View File

@@ -10,6 +10,7 @@
[frontend.util.text :as text-util]
[logseq.common.util :as common-util]
[logseq.db :as ldb]
[logseq.db.file-based.schema :as file-schema]
[logseq.db.frontend.schema :as db-schema]
[logseq.graph-parser.text :as text]))
@@ -80,7 +81,9 @@
(start! repo {}))
([repo {:keys [listen-handler]}]
(let [db-name (db-conn-state/get-repo-path repo)
db-conn (d/create-conn db-schema/schema)]
db-conn (if (config/db-based-graph? repo)
(d/create-conn db-schema/schema)
(d/create-conn file-schema/schema))]
(destroy-all!)
(swap! conns assoc db-name db-conn)
(when listen-handler

View File

@@ -527,22 +527,7 @@ tags:: tag1, tag2
@conn)
ffirst)]
(is (nil? (:block/tags updated-page))
"Page's tags are deleted")))
;; FIXME:
(testing "save deletes orphaned pages when a block's refs change"
(let [conn (db/get-db test-db false)
pages (set (map first (d/q '[:find ?bn :where [?b :block/name ?bn]] @conn)))
_ (assert (set/subset? #{"blarg" "bar"} pages) "Pages from block exist")
block-with-refs (ffirst (d/q '[:find (pull ?b [* {:block/refs [*]}])
:where [?b :block/title "block #blarg #bar"]]
@conn))
_ (save-block! (-> block-with-refs
(assoc :block/title "block"
:block/refs [])))
updated-pages (set (map first (d/q '[:find ?bn :where [?b :block/name ?bn]] @conn)))]
(is (not (contains? updated-pages "blarg"))
"Deleted, orphaned page no longer exists"))))
"Page's tags are deleted"))))
;;; Fuzzy tests