From 665d7a817c35f2b05ab43adb89da42efc4173a4e Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Fri, 29 Nov 2024 13:06:48 +0800 Subject: [PATCH] fix: tests --- .../test/logseq/graph_parser/exporter_test.cljs | 7 ++++--- docs/dev-practices.md | 2 +- src/main/frontend/handler/common/page.cljs | 1 - 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/deps/graph-parser/test/logseq/graph_parser/exporter_test.cljs b/deps/graph-parser/test/logseq/graph_parser/exporter_test.cljs index b17087d3f1..9715653ed6 100644 --- a/deps/graph-parser/test/logseq/graph_parser/exporter_test.cljs +++ b/deps/graph-parser/test/logseq/graph_parser/exporter_test.cljs @@ -20,7 +20,8 @@ [logseq.db.test.helper :as db-test] [logseq.db.frontend.rules :as rules] [logseq.common.util.date-time :as date-time-util] - [logseq.graph-parser.block :as gp-block])) + [logseq.graph-parser.block :as gp-block] + [logseq.db.frontend.content :as db-content])) ;; Helpers ;; ======= @@ -495,7 +496,7 @@ (is (= 2 (->> (find-block-by-content @conn #"replace with same start string") :block/title - (re-seq #"\[\[~\^\S+\]\]") + (re-seq db-content/id-ref-pattern) distinct count)) "A block with ref names that start with same string has 2 distinct refs") @@ -503,7 +504,7 @@ (is (= 1 (->> (find-block-by-content @conn #"replace case insensitive") :block/title - (re-seq #"\[\[~\^\S+\]\]") + (re-seq db-content/id-ref-pattern) distinct count)) "A block with different case of same ref names has 1 distinct ref")) diff --git a/docs/dev-practices.md b/docs/dev-practices.md index 856f8812ea..0564ef230c 100644 --- a/docs/dev-practices.md +++ b/docs/dev-practices.md @@ -377,7 +377,7 @@ These tasks are specific to database graphs. For these tasks there is a one time ```sh $ bb dev:db-query woot '[:find (pull ?b [*]) :where (block-content ?b "Dogma")]' DB contains 833 datoms - [{:block/tx-id 536870923, :block/link #:db{:id 100065}, :block/uuid #uuid "65565c26-f972-4400-bce4-a15df488784d", :block/updated-at 1700158508564, :block/order "a0", :block/refs [#:db{:id 100064}], :block/created-at 1700158502056, :block/format :markdown, :block/tags [#:db{:id 100064}], :block/title "Dogma #~^65565c2a-b1c5-4dc8-a0f0-81b786bc5c6d", :db/id 100090, :block/path-refs [#:db{:id 100051} #:db{:id 100064}], :block/parent #:db{:id 100051}, :block/page #:db{:id 100051}}] + [{:block/tx-id 536870923, :block/link #:db{:id 100065}, :block/uuid #uuid "65565c26-f972-4400-bce4-a15df488784d", :block/updated-at 1700158508564, :block/order "a0", :block/refs [#:db{:id 100064}], :block/created-at 1700158502056, :block/format :markdown, :block/tags [#:db{:id 100064}], :block/title "Dogma #[[65565c2a-b1c5-4dc8-a0f0-81b786bc5c6d]]", :db/id 100090, :block/path-refs [#:db{:id 100051} #:db{:id 100064}], :block/parent #:db{:id 100051}, :block/page #:db{:id 100051}}] ``` * `dev:db-transact` - Run a `d/transact!` against the queried results of a DB graph diff --git a/src/main/frontend/handler/common/page.cljs b/src/main/frontend/handler/common/page.cljs index ee9e19f0af..65d9d71e05 100644 --- a/src/main/frontend/handler/common/page.cljs +++ b/src/main/frontend/handler/common/page.cljs @@ -20,7 +20,6 @@ [frontend.modules.outliner.ui :as ui-outliner-tx] [frontend.modules.outliner.op :as outliner-op] [frontend.handler.db-based.editor :as db-editor-handler] - [logseq.db.frontend.content :as db-content] [logseq.common.util.page-ref :as page-ref] [frontend.handler.notification :as notification]))