|
|
@@ -36,7 +36,7 @@
|
|
|
(deftest filter-only-public-pages-and-blocks
|
|
|
(let [conn (ldb/start-conn)
|
|
|
_ (graph-parser/parse-file conn "page1.md" "- b11\n- b12\n- ")
|
|
|
- _ (graph-parser/parse-file conn "page2.md" "public:: true\n- b21\n- ")
|
|
|
+ _ (graph-parser/parse-file conn "page2.md" "alias:: page2-alias\npublic:: true\n- b21\n- ")
|
|
|
_ (graph-parser/parse-file conn "page3.md" "public:: true\n- b31")
|
|
|
[filtered-db assets] (publish-db/filter-only-public-pages-and-blocks @conn)
|
|
|
exported-pages (->> (d/q '[:find (pull ?b [*])
|
|
|
@@ -56,6 +56,8 @@
|
|
|
"Contains all pages that have been marked public")
|
|
|
(is (not (contains? exported-pages "page1"))
|
|
|
"Doesn't contain private page")
|
|
|
+ (is (seq (d/entity filtered-db [:block/name "page2-alias"]))
|
|
|
+ "Alias of public page is exported")
|
|
|
(is (= #{"page2" "page3"} exported-block-pages)
|
|
|
"Only exports blocks from public pages")
|
|
|
(is (= ["thumb-on-fire_1648822523866_0.PNG"] assets)
|