refactor: decouple block extraction for db graphs and exporting

Coupling db graph app to export needs could lead to bugs and is harder
to maintain. Also fix a test assertion
This commit is contained in:
Gabriel Horner
2024-08-07 18:05:24 -04:00
parent dcb73b1003
commit 3d8e579e67
3 changed files with 16 additions and 16 deletions

View File

@@ -350,8 +350,8 @@
(is (= "|markdown| table|\n|some|thing|" (:block/title (find-block-by-content @conn #"markdown.*table"))))
(is (= "multiline block\na 2nd\nand a 3rd" (:block/title (find-block-by-content @conn #"multiline block"))))
(is (= "logbook block" (:block/title (find-block-by-content @conn #"logbook block"))))
(is (is (re-find #"(?s)^Text before\n.*BEGIN_QUERY.*END_QUERY\nText after$"
(:block/title (find-block-by-content @conn #":title \"tasks"))))))
(is (re-find #"(?s)^Text before\n#\+BEGIN_QUERY.*END_QUERY\nText after$"
(:block/title (find-block-by-content @conn #":title \"tasks")))))
(testing "block refs and path-refs"
(let [block (find-block-by-content @conn "old todo block")]