Răsfoiți Sursa

fix: frontend and graph-parser tests and lints

Removed file specific test
Gabriel Horner 2 săptămâni în urmă
părinte
comite
1267a75d0d

+ 4 - 0
deps/graph-parser/.carve/ignore

@@ -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

+ 0 - 1
scripts/src/logseq/tasks/dev/db_and_file_graphs.clj

@@ -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"

+ 4 - 1
src/main/frontend/db/conn.cljs

@@ -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

+ 1 - 16
src/test/frontend/modules/outliner/core_test.cljs

@@ -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