Refactor: rename :block/content to :block/title

This commit is contained in:
Tienson Qin
2024-07-10 22:33:44 +08:00
parent a1f352773b
commit d847023dc1
113 changed files with 634 additions and 640 deletions

View File

@@ -60,7 +60,7 @@
-"}])
(p/let [conn (db/get-db test-helper/test-db false)
block (->> (d/q '[:find (pull ?b [*])
:where [?b :block/content ""]
:where [?b :block/title ""]
[?p :block/name "page1"]
[?b :block/page ?p]]
@conn)
@@ -68,9 +68,9 @@
(delete-block @conn block
{:on-delete (fn []
(let [updated-blocks (->> (d/q '[:find (pull ?b [*])
:where [?b :block/content] [(missing? $ ?b :block/pre-block?)]]
:where [?b :block/title] [(missing? $ ?b :block/pre-block?)]]
@conn)
(map (comp :block/content first)))]
(map (comp :block/title first)))]
(is (= ["b1" "b2"] updated-blocks) "Block is deleted")))})))
(testing "backspace deletes empty block in embedded context"
@@ -83,7 +83,7 @@
-"}])
(p/let [conn (db/get-db test-helper/test-db false)
block (->> (d/q '[:find (pull ?b [*])
:where [?b :block/content ""]
:where [?b :block/title ""]
[?p :block/name "page1"]
[?b :block/page ?p]]
@conn)
@@ -92,7 +92,7 @@
{:embed? true
:on-delete (fn []
(let [updated-blocks (->> (d/q '[:find (pull ?b [*])
:where [?b :block/content] [(missing? $ ?b :block/pre-block?)]]
:where [?b :block/title] [(missing? $ ?b :block/pre-block?)]]
@conn)
(map (comp :block/content first)))]
(map (comp :block/title first)))]
(is (= ["b1" "b2"] updated-blocks) "Block is deleted")))}))))