Skip to content

test(auth): comprehensive wallet verification test coverage - #170

Merged
SudiptaPaul-31 merged 2 commits into
Lumina-eX:mainfrom
Democodes-flash:feature/wallet-auth-tests
Jul 27, 2026
Merged

test(auth): comprehensive wallet verification test coverage#170
SudiptaPaul-31 merged 2 commits into
Lumina-eX:mainfrom
Democodes-flash:feature/wallet-auth-tests

Conversation

@Democodes-flash

Copy link
Copy Markdown

Changes

Updated test files

  • session.test.ts: Fix mock return values (undefined for missing cookies), add cookie attribute assertions (name, value, httpOnly, sameSite, path, expires, secure)
  • stellar.test.ts: Add real Ed25519 keypair signature test, wrong-key negative test, version byte/checksum edge cases
  • jwt.test.ts: Add parseJson catch tests (invalid JSON, binary garbage, empty strings)

New test files

  • store.test.ts: Test all store functions via mocked sql
  • middleware.test.ts: Test withAuth via mocked session
  • rbac.test.ts: Test withRbac, withAnyRbac, withAllRbac, withRole, and helper functions
  • admin.test.ts: Test withAdmin
  • constants.test.ts: Test hasPermission, hasAnyPermission, hasAllPermissions

Coverage

  • Auth modules: 99.62% stmts, 99.15% branch, 100% funcs, 99.61% lines
  • Session.ts: 100% lines, 96.42% branch
  • Stellar.ts: 98.33% lines (line 63 dead code catch unreachable)
  • All 162 tests passing across 9 test files

Closes #158

Afn-uiux added 2 commits July 25, 2026 23:02
Add comprehensive test suites for the auth modules:
- crypto.ts: SHA-256 hashing, base64url encoding, nonce/ID generation, timing-safe comparison
- jwt.ts: token signing, verification, expiration, tamper detection, round-trip
- stellar.ts: address normalization, validation, message building, signature verification

Covers nonce generation, signature verification, session token lifecycle
and error handling for invalid inputs.

Fixes Lumina-eX#158
Add/update tests for all auth modules achieving >99% coverage:

- session: Fix mock return values, add cookie attribute assertions
- stellar: Add real Ed25519 keypair signature test, wrong-key negative
  test, version byte/checksum edge cases
- jwt: Add parseJson catch tests (invalid JSON, binary garbage, empty)
- store: NEW — test all store functions via mocked sql
- middleware: NEW — test withAuth via mocked session
- rbac: NEW — test withRbac, withAnyRbac, withAllRbac, withRole, helpers
- admin: NEW — test withAdmin
- constants: NEW — test hasPermission, hasAnyPermission, hasAllPermissions

Fixes: Lumina-eX#158
@drips-wave

drips-wave Bot commented Jul 26, 2026

Copy link
Copy Markdown

@Democodes-flash 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

@SudiptaPaul-31
SudiptaPaul-31 merged commit 6d2f2d8 into Lumina-eX:main Jul 27, 2026
1 check passed
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.

[Feature]: Wallet-Based Identity Verification

3 participants