Skip to content

test: enhance and harden QA suites (e2e, jwt, settlement, invoice.service) - #432

Merged
Chucks1093 merged 2 commits into
StellarState:devfrom
CeceOs92:test/harden-qa-suites-346-349
Aug 31, 2026
Merged

test: enhance and harden QA suites (e2e, jwt, settlement, invoice.service)#432
Chucks1093 merged 2 commits into
StellarState:devfrom
CeceOs92:test/harden-qa-suites-346-349

Conversation

@CeceOs92

Copy link
Copy Markdown
Contributor

Enhances and optimizes four test files per issues #346-#349. All four suites failed to compile on dev (garbled code from #424 / #431), so this also lands the minimal source fixes needed to unblock them.

Target suites: 0 -> 101 passing tests.

Source fixes (prerequisite):

  • invoice.service.ts: remove dead try/catch block spliced into getInvoiceTokenHolders (referenced undefined uploadResult / input).
  • User.model.ts: replace invalid Omit<User,"deleted_at"> return type on toPublicDTO with an explicit Pick<>; restore missing class-closing brace.
  • Invoice.model.ts: readonly transition-map type; restore missing brace; drop now-unused BeforeInsert/BeforeUpdate imports.

#346 full-flow.e2e.test.ts:

  • extract duplicated seller/investor challenge-response into authenticateViaChallenge() helper
  • wrap beforeAll harness bring-up in try/catch with structured logging
  • add jest.setTimeout(30_000) against sporadic CI timeouts

#347 auth-jwt-validation.test.ts:

  • build the test app once in beforeAll instead of ~25 times
  • add signToken / getMe / expectRejected helpers; collapse ~20 cases into two it.each tables
  • assert the middleware's real granular messages (Invalid token payload., User no longer exists.); all failure modes still return the 401 envelope

#348 settlement.integration.test.ts:

  • fix 2 broken tests: the log lookup matched the funding transition (published -> funded) emitted by fullyFundInvoice, not settlement's
  • add findSettlementTransitionLog / findSettlementCompletionLog helpers and route all log assertions through them

#349 invoice.service.test.ts:

  • add buildCreateInput() factory and wireCreatePassthrough() helper
  • convert net-amount tests to an it.each table exercising the real calculation, keeping the 29.99 @ 0.5% IEEE-754 regression guard

Closes #346
Closes #347
Closes #348
Closes #349

…vice)

Enhances and optimizes four test files per issues StellarState#346-StellarState#349. All four suites
failed to compile on dev (garbled code from StellarState#424 / StellarState#431), so this also lands
the minimal source fixes needed to unblock them.

Target suites: 0 -> 101 passing tests.

Source fixes (prerequisite):
- invoice.service.ts: remove dead try/catch block spliced into
  getInvoiceTokenHolders (referenced undefined uploadResult / input).
- User.model.ts: replace invalid Omit<User,"deleted_at"> return type on
  toPublicDTO with an explicit Pick<>; restore missing class-closing brace.
- Invoice.model.ts: readonly transition-map type; restore missing brace;
  drop now-unused BeforeInsert/BeforeUpdate imports.

StellarState#346 full-flow.e2e.test.ts:
- extract duplicated seller/investor challenge-response into
  authenticateViaChallenge() helper
- wrap beforeAll harness bring-up in try/catch with structured logging
- add jest.setTimeout(30_000) against sporadic CI timeouts

StellarState#347 auth-jwt-validation.test.ts:
- build the test app once in beforeAll instead of ~25 times
- add signToken / getMe / expectRejected helpers; collapse ~20 cases into
  two it.each tables
- assert the middleware's real granular messages (Invalid token payload.,
  User no longer exists.); all failure modes still return the 401 envelope

StellarState#348 settlement.integration.test.ts:
- fix 2 broken tests: the log lookup matched the funding transition
  (published -> funded) emitted by fullyFundInvoice, not settlement's
- add findSettlementTransitionLog / findSettlementCompletionLog helpers and
  route all log assertions through them

StellarState#349 invoice.service.test.ts:
- add buildCreateInput() factory and wireCreatePassthrough() helper
- convert net-amount tests to an it.each table exercising the real
  calculation, keeping the 29.99 @ 0.5% IEEE-754 regression guard

Closes StellarState#346
Closes StellarState#347
Closes StellarState#348
Closes StellarState#349

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@drips-wave

drips-wave Bot commented Aug 31, 2026

Copy link
Copy Markdown

@CeceOs92 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

@Chucks1093
Chucks1093 merged commit e34661b into StellarState:dev Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants