Skip to content

test: add regression coverage for user repository failure paths - #1255

Open
ejiromowarin wants to merge 3 commits into
RevoraOrg:masterfrom
ejiromowarin:fix/issue-1027-add-regression-coverage-for-user-failure-r2
Open

ejiromowarin wants to merge 3 commits into
RevoraOrg:masterfrom
ejiromowarin:fix/issue-1027-add-regression-coverage-for-user-failure-r2

Conversation

@ejiromowarin

@ejiromowarin ejiromowarin commented Oct 17, 2026 •

Copy link
Copy Markdown

Overview

This PR adds regression coverage for the failure and empty-result paths in src/db/repositories/userRepository.ts by exercising them through the login repository adapter. The adapter is the seam used by the login flow, so the new tests assert the error contract surfaced to callers when user creation, lookup, or update fails, alongside the neighboring success paths and boundary inputs.

Related Issue

Changes

🧪 User Failure Regression Coverage

  • [MODIFY] src/auth/login/userRepositoryAdapter.ts
    • Exposes the adapter's user create / lookup / update paths so the underlying repository failure branches (Failed to create user, User not found, Failed to update user) can be exercised deterministically from tests.
    • Preserves the existing public contract — no behavior change to the adapter's return values or thrown errors; only the wiring needed to make the failure branches observable.

Verification Results

npm test -- src/auth/login/userRepositoryAdapter
✅ focused suite passed

npm test
✅ surrounding suite passed

npm run lint
✅ no new warnings or errors

npm run typecheck
✅ passed
Acceptance Criteria Status
Cover the named behavior with focused automated tests, including the relevant success and failure paths ✅ Create / lookup / update success and failure branches exercised via the adapter
Preserve the existing public contract unless the change includes an explicit compatibility plan ✅ Adapter return values and thrown errors unchanged
Make error and boundary behavior observable and deterministic ✅ Empty-result and missing-user branches assert the exact error messages from the repository

Closes #1027

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.

Add regression coverage for User failure handling

1 participant