Add vendor pre-population for bulk code and individual edit forms
- Add vendor-changed HTMX handlers for both bulk code and individual edit - Pre-populate default account at 100% when vendor is selected and no accounts exist - Fix render-accounts-section to render from step-params correctly - Change bulk code vendor-changed from hx-get to hx-post to include form data - Add routes for vendor-changed endpoints - Update e2e tests to cover vendor pre-population - Run lein cljfmt fix across codebase
This commit is contained in:
@@ -19,15 +19,13 @@
|
||||
:approval-status :transaction-approval-status/unapproved
|
||||
:description-simple "simple-description"})
|
||||
|
||||
|
||||
|
||||
(t/deftest rule-applying-fn
|
||||
(t/testing "Should apply if description matches"
|
||||
(t/is (sut/rule-applies?
|
||||
base-transaction
|
||||
{:transaction-rule/description #"original-description"
|
||||
:transaction-rule/transaction-approval-status :transaction-approval-status/approved}))
|
||||
|
||||
|
||||
(t/is (not (sut/rule-applies?
|
||||
base-transaction
|
||||
{:transaction-rule/description #"xxx"
|
||||
@@ -42,7 +40,7 @@
|
||||
(let [process (sut/rule-applying-fn [{:transaction-rule/description "simple-description"
|
||||
:transaction-rule/transaction-approval-status :transaction-approval-status/approved}])
|
||||
transaction (assoc base-transaction :transaction/description-original "simple-description")]
|
||||
(t/is (= :transaction-approval-status/approved
|
||||
(t/is (= :transaction-approval-status/approved
|
||||
(:transaction/approval-status (process transaction ["NG"]))))))
|
||||
|
||||
(t/testing "spread cents"
|
||||
@@ -79,5 +77,4 @@
|
||||
(t/is (= [0.01 0.01]
|
||||
(map :transaction-account/amount (:transaction/accounts (process (assoc transaction :transaction/amount 0.02) ["NG" "BT" "DE"])))))
|
||||
(t/is (= [0.02 0.01 0.01]
|
||||
(map :transaction-account/amount (:transaction/accounts (process (assoc transaction :transaction/amount 0.04) ["NG" "BT" "DE"])))))
|
||||
)))
|
||||
(map :transaction-account/amount (:transaction/accounts (process (assoc transaction :transaction/amount 0.04) ["NG" "BT" "DE"]))))))))
|
||||
|
||||
Reference in New Issue
Block a user