Skip to content

test(admin): add tests for reconciliation status grouping - #395

Open
thetejuuu wants to merge 2 commits into
Rotula-Labs:mainfrom
thetejuuu:fix/issue-28-test-admin-add-tests-for-the-reconciliation
Open

thetejuuu wants to merge 2 commits into
Rotula-Labs:mainfrom
thetejuuu:fix/issue-28-test-admin-add-tests-for-the-reconciliation

Conversation

@thetejuuu

Copy link
Copy Markdown

Overview

This PR adds unit tests for the GET /admin/reconciliation/status aggregation in src/routes/admin.routes.ts. The grouping loop and totalUnresolved count are the only aggregation operators rely on to gauge the unresolved backlog, so this change locks in the expected behavior with a mocked prisma client.

Related Issue

Changes

🧪 Reconciliation Status Tests

  • [ADD] src/__tests__/admin.reconciliation.status.test.ts
    • Mocks prisma so reconciliationMismatch.findMany returns controlled fixtures.
    • Covers the empty result case: zero group entries and totalUnresolved: 0.
    • Covers two mismatches in the same group: a single group entry with mismatchCount: 2.
    • Covers mismatches across two groups: two group entries with the correct per-group counts.
    • Asserts totalUnresolved equals the number of returned rows.
    • Asserts the findMany filter includes resolvedAt: null, so resolved rows are excluded from the backlog.

Verification Results

npm test -- src/__tests__/admin.reconciliation.status.test.ts
✅ 4/4 passed
Acceptance Criteria Status
Test file exists and asserts the four scenarios ✅ Empty, same-group, cross-group, and filter cases covered
totalUnresolved equals the number of returned rows ✅ Asserted in each scenario
Query filter excludes resolved rows ✅ resolvedAt: null asserted on the findMany call
npm test passes locally ✅ Test file passes

Closes #28

Toyosi5566 and others added 2 commits October 16, 2026 15:32
.env is read by dotenv.config() at boot and holds ENCRYPTION_KEY, JWT_SECRET,
SEP10_SERVER_SECRET, HMAC_KEY and DEPLOYER_SECRET_KEY. None of the .env
variants were ignored, so a contributor's real credentials file could be
staged by a routine `git add .` with nothing to warn anyone. Ignore the
.env variants and keep the committed example file trackable.

No .env file is tracked at HEAD and no .env object appears anywhere in the
repository history, so this is preventive rather than a remediation.
@drips-wave

drips-wave Bot commented Oct 17, 2026

Copy link
Copy Markdown

@thetejuuu Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Abdul-dev-creator
Abdul-dev-creator force-pushed the main branch 2 times, most recently from af3277b to a2a4455 Compare October 18, 2026 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(admin): add tests for the reconciliation status grouping

2 participants