rules can be edited fully and more.

This commit is contained in:
Bryce Covert
2019-05-12 20:31:28 -07:00
parent 51691fa553
commit 76c903d16d
16 changed files with 132 additions and 38 deletions

View File

@@ -47,8 +47,7 @@
{:transaction-rule {:accounts [{:account-id account-id
:percentage "0.25"
:location "B"}]}}
[:id ]])}]})
]
[:id ]])}]})]
(is (thrown? clojure.lang.ExceptionInfo (sut/query nil q)))))
(testing "it should add rules"
(let [q (v/graphql-query {:venia/operation {:operation/type :mutation
@@ -56,6 +55,7 @@
:venia/queries [{:query/data (sut/->graphql [:upsert-transaction-rule
{:transaction-rule {:description "123"
:vendor-id vendor-id
:transaction-approval-status :approved
:accounts [{:account-id account-id
:percentage "0.5"
:location "B"}
@@ -63,6 +63,7 @@
:percentage "0.5"
:location "A"}]}}
[:id :description
:transaction-approval-status
[:vendor [:name]]
[:accounts [:id :percentage [:account [:name]]]]]])}]})
result (-> (sut/query nil q)
@@ -71,6 +72,7 @@
(is (= "123" (:description result)))
(is (= "Bryce's Meat Co" (-> result :vendor :name)))
(is (= :approved (:transaction-status result)))
(is (= "hello" (-> result :accounts (get 0) :account :name )))
(is (:id result))
(testing "it should delete removed rules"