Skip to content

Commit

Permalink
test(feature): expect correct summary calculations
Browse files Browse the repository at this point in the history
  • Loading branch information
KennethTrecy committed Sep 2, 2023
1 parent 3aa8a19 commit 8700fab
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions t/Feature/Resource/FrozenPeriodTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -570,19 +570,17 @@ public function testValidChainCreate()
"frozen_period_id" => $first_frozen_period->id,
"account_id" => $equity_account->id,
"unadjusted_debit_amount" => "0",
"unadjusted_credit_amount" => $recorded_normal_financial_entry->credit_amount,
"unadjusted_credit_amount" => "2500",
"adjusted_debit_amount" => "0",
"adjusted_credit_amount" => $recorded_normal_financial_entry
->credit_amount
->minus($closed_financial_entry->debit_amount)
"adjusted_credit_amount" => "2000"
])->create();
$first_asset_summary_calculation = $summary_calculation_fabricator->setOverrides([
"frozen_period_id" => $first_frozen_period->id,
"account_id" => $asset_account->id,
"unadjusted_debit_amount" => $recorded_normal_financial_entry->debit_amount,
"unadjusted_credit_amount" => $recorded_expense_financial_entry->credit_amount,
"adjusted_debit_amount" => $recorded_normal_financial_entry->debit_amount,
"adjusted_credit_amount" => $recorded_expense_financial_entry->credit_amount
"unadjusted_debit_amount" => "2500",
"unadjusted_credit_amount" => "0",
"adjusted_debit_amount" => "2000",
"adjusted_credit_amount" => "0"
])->create();
$first_expense_summary_calculation = $summary_calculation_fabricator->setOverrides([
"frozen_period_id" => $first_frozen_period->id,
Expand Down Expand Up @@ -611,6 +609,20 @@ public function testValidChainCreate()
]);
$this->seeNumRecords(2, "frozen_periods", []);
$this->seeNumRecords(6, "summary_calculations", []);
$this->seeInDatabase("summary_calculations", [
"account_id" => $asset_account->id,
"unadjusted_debit_amount" => "2750",
"unadjusted_credit_amount" => "0",
"adjusted_debit_amount" => "2750",
"adjusted_credit_amount" => "0"
]);
$this->seeInDatabase("summary_calculations", [
"account_id" => $equity_account->id,
"unadjusted_debit_amount" => "0",
"unadjusted_credit_amount" => "3000",
"adjusted_debit_amount" => "0",
"adjusted_credit_amount" => "2750"
]);
}

public function testInvalidCreate()
Expand Down

0 comments on commit 8700fab

Please sign in to comment.