Files
integreat/test/clj/auto_ap/graphql.clj
2019-05-07 07:10:21 -07:00

16 lines
617 B
Clojure

(ns test.auto-ap.graphql
(:require [auto-ap.graphql :as sut]
[clojure.test :as t :refer [deftest is testing]]))
(deftest query
(testing "it should find rules"
(let [result (:transaction-rule-page (:data (sut/query nil "{ transaction_rule_page(client_id: null) { count, start, transaction_rules { id } }}")))]
(is (int? (:count result)))
(is (int? (:start result)))
(is (seqable? (:transaction-rules result)))))
(testing "it should find ledger entries"
(is (= {:data {:ledger-page {:count 100}}}
(sut/query nil "{ ledger_page(client_id: null) { count }}")))))