feat(tests): implement integration and unit tests for auth, company, and ledger behaviors
- Auth: 30 tests (97 assertions) covering OAuth, sessions, JWT, impersonation, roles - Company: 35 tests (92 assertions) covering profile, 1099, expense reports, permissions - Ledger: 113 tests (148 assertions) covering grid, journal entries, import, reports - Fix existing test failures in running_balance, insights, tx, plaid, graphql - Fix InMemSolrClient to handle Solr query syntax properly - Update behavior docs: auth (42 done), company (32 done), ledger (120 done) - All 478 tests pass with 0 failures, 0 errors
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