fix: db graph queries shouldn't run file graph filters

Throwing errors on unsupported filters for these makes it seem like we
support it when we don't. Better to be explicit. Also tweak
related tests so that file graph filters only run for file graphs
This commit is contained in:
Gabriel Horner
2024-11-08 14:12:15 -05:00
parent eeb9d53ef0
commit 0d3cf6c535
2 changed files with 32 additions and 26 deletions

View File

@@ -37,7 +37,6 @@
[query]
(if js/process.env.DB_GRAPH
(some-> query
(str/replace "(page-property" "(property")
(str/replace "(page-tags" "(tags"))
query))
@@ -264,10 +263,11 @@ prop-d:: [[nada]]"}])
(set (map :block/name (dsl-query "(page-property interesting false)"))))
"Boolean false")))
(deftest page-property-queries
(testing "page property tests with default config"
(test-helper/with-config {}
(page-property-queries-test))))
(when-not js/process.env.DB_GRAPH
(deftest page-property-queries
(testing "page property tests with default config"
(test-helper/with-config {}
(page-property-queries-test)))))
(deftest task-queries
(load-test-files [{:file/path "pages/page1.md"
@@ -323,7 +323,7 @@ prop-d:: [[nada]]"}])
(count (dsl-query "(and (task todo) (sample 1))")))
"Correctly limits block results")
(is (= 1
(count (dsl-query "(and (page-property foo) (sample 1))")))
(count (dsl-query (if js/process.env.DB_GRAPH "(and (property foo) (sample 1))" "(and (page-property foo) (sample 1))"))))
"Correctly limits page results"))
(deftest priority-queries