fix: simple task queries and start fixing db dsl-query tests

Tests caught that task query wasn't working. Also disabled
namaspace test and rule for db graphs since they aren't supported
there
This commit is contained in:
Gabriel Horner
2024-06-04 15:53:36 -04:00
parent 33e9df34aa
commit e7f795103d
5 changed files with 109 additions and 27 deletions

View File

@@ -622,17 +622,18 @@ created-at:: 1608968448116
[(contains? #{"A"} ?priority)]))]
(frontend.db/get-db test-db))))
(deftest namespace-queries
(load-test-files [{:file/path "pages/ns1.page1.md"
:file/content "foo"}
{:file/path "pages/ns1.page2.md"
:file/content "bar"}
{:file/path "pages/ns2.page1.md"
:file/content "baz"}])
(when-not js/process.env.DB_GRAPH
(deftest namespace-queries
(load-test-files [{:file/path "pages/ns1.page1.md"
:file/content "foo"}
{:file/path "pages/ns1.page2.md"
:file/content "bar"}
{:file/path "pages/ns2.page1.md"
:file/content "baz"}])
(is (= #{"ns1/page1" "ns1/page2"}
(set (map :block/name (dsl-query "(namespace ns1)")))))
(is (= #{"ns1/page1" "ns1/page2"}
(set (map :block/name (dsl-query "(namespace ns1)")))))
(is (= #{}
(set (map :block/name (dsl-query "(namespace blarg)"))))
"Correctly returns no results"))
(is (= #{}
(set (map :block/name (dsl-query "(namespace blarg)"))))
"Correctly returns no results")))