mirror of
https://github.com/logseq/logseq.git
synced 2026-02-01 22:47:36 +00:00
fix: frontend and graph-parser tests and lints
Removed file specific test
This commit is contained in:
4
deps/graph-parser/.carve/ignore
vendored
4
deps/graph-parser/.carve/ignore
vendored
@@ -21,3 +21,7 @@ logseq.graph-parser.text/get-page-name
|
|||||||
logseq.graph-parser.text/get-namespace-last-part
|
logseq.graph-parser.text/get-namespace-last-part
|
||||||
;; API
|
;; API
|
||||||
logseq.graph-parser.whiteboard/shape->block
|
logseq.graph-parser.whiteboard/shape->block
|
||||||
|
;; API
|
||||||
|
logseq.graph-parser/parse-file
|
||||||
|
;; API
|
||||||
|
logseq.graph-parser/filter-files
|
||||||
@@ -76,7 +76,6 @@
|
|||||||
(def file-graph-paths
|
(def file-graph-paths
|
||||||
"Paths _only_ for file graphs"
|
"Paths _only_ for file graphs"
|
||||||
["deps/db/src/logseq/db/file_based"
|
["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/extract.cljc"
|
||||||
"deps/graph-parser/src/logseq/graph_parser/property.cljs"
|
"deps/graph-parser/src/logseq/graph_parser/property.cljs"
|
||||||
"deps/graph-parser/src/logseq/graph_parser.cljs"
|
"deps/graph-parser/src/logseq/graph_parser.cljs"
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
[frontend.util.text :as text-util]
|
[frontend.util.text :as text-util]
|
||||||
[logseq.common.util :as common-util]
|
[logseq.common.util :as common-util]
|
||||||
[logseq.db :as ldb]
|
[logseq.db :as ldb]
|
||||||
|
[logseq.db.file-based.schema :as file-schema]
|
||||||
[logseq.db.frontend.schema :as db-schema]
|
[logseq.db.frontend.schema :as db-schema]
|
||||||
[logseq.graph-parser.text :as text]))
|
[logseq.graph-parser.text :as text]))
|
||||||
|
|
||||||
@@ -80,7 +81,9 @@
|
|||||||
(start! repo {}))
|
(start! repo {}))
|
||||||
([repo {:keys [listen-handler]}]
|
([repo {:keys [listen-handler]}]
|
||||||
(let [db-name (db-conn-state/get-repo-path repo)
|
(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!)
|
(destroy-all!)
|
||||||
(swap! conns assoc db-name db-conn)
|
(swap! conns assoc db-name db-conn)
|
||||||
(when listen-handler
|
(when listen-handler
|
||||||
|
|||||||
@@ -527,22 +527,7 @@ tags:: tag1, tag2
|
|||||||
@conn)
|
@conn)
|
||||||
ffirst)]
|
ffirst)]
|
||||||
(is (nil? (:block/tags updated-page))
|
(is (nil? (:block/tags updated-page))
|
||||||
"Page's tags are deleted")))
|
"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"))))
|
|
||||||
|
|
||||||
;;; Fuzzy tests
|
;;; Fuzzy tests
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user