enhance: journal pages and blocks are created on their journal day

Fixes https://github.com/logseq/db-test/issues/77
This commit is contained in:
Gabriel Horner
2024-11-13 14:20:01 -05:00
parent 8dbfe92fca
commit b250e262d2
3 changed files with 41 additions and 7 deletions

View File

@@ -18,7 +18,8 @@
[logseq.db :as ldb]
[logseq.outliner.db-pipeline :as db-pipeline]
[logseq.db.test.helper :as db-test]
[logseq.db.frontend.rules :as rules]))
[logseq.db.frontend.rules :as rules]
[logseq.common.util.date-time :as date-time-util]))
;; Helpers
;; =======
@@ -359,6 +360,14 @@
(rest (expand-children (d/entity @conn (:db/id (find-page-by-name @conn "n2"))) nil)))
"First namespace tests duplicate child page name and built-in page name")))
(testing "journal timestamps"
(is (= (date-time-util/journal-day->ms 20240207)
(:block/created-at (find-page-by-name @conn "Feb 7th, 2024")))
"journal pages are created on their journal day")
(is (= (date-time-util/journal-day->ms 20240207)
(:block/created-at (find-block-by-content @conn #"Inception")))
"journal blocks are created on their page's journal day"))
(testing "db attributes"
(is (= true
(:block/collapsed? (find-block-by-content @conn "collapsed block")))