Skip to content

Commit be8810b

Browse files
committed
fix(purchases): cite #625 in cancelled-KPI regression tests
summarizePurchaseHistory already excludes cancelled rows from dollar totals (landed in #737 against #736). Issue #625 describes the same bug -- this commit updates the two existing regression-test comments and assertion messages to cite both issues so the PR can formally close #625. Closes #625
1 parent 4956d66 commit be8810b

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

‎internal/api/handler_history_test.go‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1350,8 +1350,8 @@ func TestHandler_getHistory_CompletedExecutionNotDuplicated(t *testing.T) {
13501350
}
13511351

13521352
// TestSummarizePurchaseHistory_CancelledExcludedFromKPIs is the regression
1353-
// test for issue #736. Cancelling a pending purchase must not add its upfront
1354-
// cost or savings to the KPI totals. Specifically:
1353+
// test for issues #625 and #736. Cancelling a pending purchase must not add
1354+
// its upfront cost or savings to the KPI totals. Specifically:
13551355
// - TotalUpfront, TotalMonthlySavings, TotalAnnualSavings must reflect only
13561356
// the approved/completed rows.
13571357
// - TotalCompleted must not include cancelled rows.
@@ -1377,17 +1377,17 @@ func TestSummarizePurchaseHistory_CancelledExcludedFromKPIs(t *testing.T) {
13771377
assert.Equal(t, 1, summary.TotalPending)
13781378

13791379
assert.InDelta(t, 350.0, summary.TotalUpfront, 0.001,
1380-
"cancelled upfront cost must not be included in TotalUpfront (issue #736)")
1380+
"cancelled upfront cost must not be included in TotalUpfront (issues #625, #736)")
13811381
assert.InDelta(t, 35.0, summary.TotalMonthlySavings, 0.001,
1382-
"cancelled savings must not be included in TotalMonthlySavings (issue #736)")
1382+
"cancelled savings must not be included in TotalMonthlySavings (issues #625, #736)")
13831383
assert.InDelta(t, 420.0, summary.TotalAnnualSavings, 0.001,
1384-
"TotalAnnualSavings = TotalMonthlySavings * 12 and must exclude cancelled (issue #736)")
1384+
"TotalAnnualSavings = TotalMonthlySavings * 12 and must exclude cancelled (issues #625, #736)")
13851385
}
13861386

13871387
// TestSummarizePurchaseHistory_CancelPendingDoesNotChangeKPIs mirrors the
1388-
// QA reproduction scenario from issue #736: start with N approved purchases,
1389-
// observe KPI totals, then add a cancelled execution and assert the totals
1390-
// are unchanged.
1388+
// QA reproduction scenario from issues #625 and #736: start with N approved
1389+
// purchases, observe KPI totals, then add a cancelled execution and assert the
1390+
// totals are unchanged.
13911391
func TestSummarizePurchaseHistory_CancelPendingDoesNotChangeKPIs(t *testing.T) {
13921392
// Baseline: three approved (completed) rows.
13931393
baseline := []config.PurchaseHistoryRecord{
@@ -1406,11 +1406,11 @@ func TestSummarizePurchaseHistory_CancelPendingDoesNotChangeKPIs(t *testing.T) {
14061406
after := summarizePurchaseHistory(withCancelled)
14071407

14081408
assert.Equal(t, before.TotalUpfront, after.TotalUpfront,
1409-
"cancelling a pending purchase must not change TotalUpfront (issue #736)")
1409+
"cancelling a pending purchase must not change TotalUpfront (issues #625, #736)")
14101410
assert.Equal(t, before.TotalMonthlySavings, after.TotalMonthlySavings,
1411-
"cancelling a pending purchase must not change TotalMonthlySavings (issue #736)")
1411+
"cancelling a pending purchase must not change TotalMonthlySavings (issues #625, #736)")
14121412
assert.Equal(t, before.TotalAnnualSavings, after.TotalAnnualSavings,
1413-
"cancelling a pending purchase must not change TotalAnnualSavings (issue #736)")
1413+
"cancelling a pending purchase must not change TotalAnnualSavings (issues #625, #736)")
14141414
assert.Equal(t, before.TotalCompleted, after.TotalCompleted,
1415-
"cancelling a pending purchase must not change TotalCompleted (issue #736)")
1415+
"cancelling a pending purchase must not change TotalCompleted (issues #625, #736)")
14161416
}

0 commit comments

Comments
 (0)