made cloud tests work again.
This commit is contained in:
@@ -77,7 +77,7 @@
|
||||
(t/deftest transaction->txs
|
||||
(t/testing "Should import and code transactions"
|
||||
(t/testing "Should import one transaction"
|
||||
(let [{:strs [bank-account-id client-id]} (:tempids (dc/transact conn
|
||||
(let [{:strs [bank-account-id client-id]} (:tempids @(dc/transact conn
|
||||
[{:db/id "bank-account-id"
|
||||
:bank-account/code "TEST-1"}
|
||||
{:db/id "client-id"
|
||||
@@ -107,6 +107,7 @@
|
||||
:db/id "client-id"
|
||||
:bank-accounts ["bank-account-id"]}]
|
||||
(dc/transact conn)
|
||||
deref
|
||||
:tempids)]
|
||||
|
||||
(let [transaction-result (sut/transaction->txs (assoc base-transaction
|
||||
@@ -132,7 +133,7 @@
|
||||
(:transaction/payment transaction-result)))))
|
||||
|
||||
(t/testing "Should not match an already matched check"
|
||||
(dc/transact conn [{:db/id payment-id :payment/status :payment-status/cleared}])
|
||||
@(dc/transact conn [{:db/id payment-id :payment/status :payment-status/cleared}])
|
||||
(let [result (sut/transaction->txs (assoc base-transaction
|
||||
:transaction/description-original "CHECK 10001"
|
||||
:transaction/amount -30.0)
|
||||
@@ -158,6 +159,7 @@
|
||||
:locations ["MF"]
|
||||
:bank-accounts ["bank-account-id"]}]
|
||||
(dc/transact conn)
|
||||
deref
|
||||
:tempids)]
|
||||
|
||||
|
||||
@@ -255,6 +257,7 @@
|
||||
#:vendor {:name "Autopay vendor 2"
|
||||
:db/id "vendor2-id"}]
|
||||
(dc/transact conn)
|
||||
deref
|
||||
:tempids)]
|
||||
(t/testing "Should find a single invoice that matches exactly"
|
||||
(let [{:strs [client-id]} (->> [#:invoice {:status :invoice-status/paid
|
||||
@@ -266,6 +269,7 @@
|
||||
:db/id "invoice-id"}
|
||||
#:client {:name "Client" :db/id "client-id"}]
|
||||
(dc/transact conn)
|
||||
deref
|
||||
:tempids)
|
||||
invoices-matches (sut/match-transaction-to-single-unfulfilled-autopayments -30.0 client-id)]
|
||||
(t/is (= 1 (count invoices-matches)))
|
||||
@@ -280,6 +284,7 @@
|
||||
:db/id "invoice-id"}
|
||||
#:client {:name "Client" :db/id "client-id"}]
|
||||
(dc/transact conn)
|
||||
deref
|
||||
:tempids)
|
||||
invoices-matches (sut/match-transaction-to-single-unfulfilled-autopayments -30.0 client-id)]
|
||||
|
||||
@@ -295,6 +300,7 @@
|
||||
:db/id "invoice-id"}
|
||||
#:client {:name "Client" :db/id "client-id"}]
|
||||
(dc/transact conn)
|
||||
deref
|
||||
:tempids)
|
||||
invoices-matches (sut/match-transaction-to-single-unfulfilled-autopayments -30.0 client-id)]
|
||||
|
||||
@@ -313,6 +319,7 @@
|
||||
#:client {:name "Client"
|
||||
:db/id "client-id"}]
|
||||
(dc/transact conn)
|
||||
deref
|
||||
:tempids)
|
||||
invoices-matches (sut/match-transaction-to-single-unfulfilled-autopayments -30.0
|
||||
client-id)]
|
||||
@@ -334,6 +341,7 @@
|
||||
:db/id "invoice2-id"}
|
||||
#:client {:name "Client" :db/id "client-id"}]
|
||||
(dc/transact conn)
|
||||
deref
|
||||
:tempids)
|
||||
invoices-matches (sut/match-transaction-to-single-unfulfilled-autopayments -30.0 client-id)]
|
||||
(t/is (= 2 (count invoices-matches))
|
||||
@@ -355,6 +363,7 @@
|
||||
:db/id "invoice2-id"}
|
||||
#:client {:name "Client" :db/id "client-id"}]
|
||||
(dc/transact conn)
|
||||
deref
|
||||
:tempids)
|
||||
invoices-matches (sut/match-transaction-to-single-unfulfilled-autopayments -30.0 client-id)]
|
||||
(t/is (= 0 (count invoices-matches))
|
||||
@@ -377,6 +386,7 @@
|
||||
:db/id "invoice2-id"}
|
||||
#:client {:name "Client" :db/id "client-id"}]
|
||||
(dc/transact conn)
|
||||
deref
|
||||
:tempids)
|
||||
invoices-matches (sut/match-transaction-to-single-unfulfilled-autopayments -30.0 client-id)]
|
||||
(t/is (= 0 (count invoices-matches))
|
||||
@@ -406,6 +416,7 @@
|
||||
:db/id "invoice3-id"}
|
||||
#:client {:name "Client" :db/id "client-id"}]
|
||||
(dc/transact conn)
|
||||
deref
|
||||
:tempids)]
|
||||
(t/is (= 2 (count (sut/match-transaction-to-single-unfulfilled-autopayments -40.0 client-id)))
|
||||
(str "Expected to match with the chronologically adjacent invoice-1 and invoice-3."))
|
||||
|
||||
Reference in New Issue
Block a user