fix: strengthen deactivation-exclusion test and align sign rule with canonical logic

- teams.service.spec.ts: pick a checkpoint older than the adjustment's own
  month so the exclusion test actually fails without the exclusion filter
- teams.service.ts: only negate fine/levy/fee amounts when positive,
  matching TeamMembersService.recomputeBalance and Transaction.setBalance()
  exactly, instead of negating unconditionally
- teams.service.ts: outstanding-history helper now returns a positive
  value when players owe money, matching the house convention already
  established by getOverview()'s team.outstanding
- overview.spec.ts: assert the balance chart's legend becomes visible
- teams.service.spec.ts: add coverage for inactive-player exclusion and
  a positive-balance (prepaid credit) case

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Bastian Wagner
2026-08-03 11:24:34 +02:00
parent ebfaac7590
commit 3cb8cd9a4a
3 changed files with 94 additions and 10 deletions

View File

@@ -197,6 +197,7 @@ describe('Overview', () => {
expect(balanceChart.data.datasets[0].data).toEqual([100, 125]);
expect(balanceChart.data.datasets[1].label).toBe('Theoretisch (inkl. offene Beiträge)');
expect(balanceChart.data.datasets[1].data).toEqual([100, 150]);
expect(balanceChart.options?.plugins?.legend?.position).toBe('bottom');
expect(flowChart.type).toBe('bar');
expect(flowChart.data.datasets).toHaveLength(2);
expect(outstandingChart.type).toBe('bar');