Skip to content

Commit

Permalink
test(feature): add other flow calculation for correct shown data
Browse files Browse the repository at this point in the history
  • Loading branch information
KennethTrecy committed May 25, 2024
1 parent 3dd3aa8 commit a003e1e
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions t/Feature/Resource/FrozenPeriodTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,12 @@ public function testDefaultShow()
"account_id" => $equity_account->id,
"net_amount" => $recorded_normal_financial_entry->credit_amount
])->create();
$expense_flow_calculation = $flow_calculation_fabricator->setOverrides([
"frozen_period_id" => $frozen_period->id,
"cash_flow_category_id" => $illiquid_cash_flow_category->id,
"account_id" => $expense_account->id,
"net_amount" => $recorded_expense_financial_entry->debit_amount->negated()
])->create();

$result = $authenticated_info
->getRequest()
Expand Down Expand Up @@ -241,11 +247,11 @@ public function testDefaultShow()
"opened_liquid_amount" => "0",
"closed_liquid_amount" => $recorded_normal_financial_entry
->debit_amount
->minus($closed_financial_entry->credit_amount),
->minus($recorded_expense_financial_entry->debit_amount),
"subtotals" => [
[
"cash_flow_category_id" => $illiquid_cash_flow_category->id,
"net_income" => $recorded_normal_financial_entry
"net_income" => $recorded_expense_financial_entry
->debit_amount
->negated(),
"subtotal" => $recorded_normal_financial_entry
Expand Down Expand Up @@ -283,8 +289,9 @@ public function testDefaultShow()
$expense_summary_calculation
])),
"flow_calculations" => json_decode(json_encode([
$equity_flow_calculation,
$asset_flow_calculation,
$equity_flow_calculation,
$expense_flow_calculation
])),
]);
}
Expand Down

0 comments on commit a003e1e

Please sign in to comment.