mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 16:02:26 +00:00
Add 4 new test files covering previously untested payment/zap logic: - lnurl.test.mjs: bech32 encode/decode roundtrip, resolveLightningAddress (email, lnurl, URL formats), fetchPayServiceData (success, HTTP errors, invalid JSON, error status), validateInvoiceAmount (boundaries, invalid inputs), requestInvoice (comment truncation, amount formats, error paths) - platform-fee.test.mjs: parsePercentValue (numbers, bigints, strings with %, fractions, edge cases), clampPercent (boundaries, NaN, non-finite), getDefaultPlatformFeePercent, resolvePlatformFeePercent (override vs fallback behavior) - zap-receipt-validator.test.mjs: computeZapRequestHash determinism, extractDescriptionHashFromBolt11, validateZapReceipt covering all failure modes (missing request, invalid JSON, no relays, missing invoice, hash mismatch, amount mismatch, wrong pubkey, invalid signature, no receipt found) plus success path and override injection - zap-requests.test.mjs: normalizeRelayList (dedup, filtering, empty), resolveLnurlTag (bech32 vs email addresses), buildZapRequestPayload (minimal and full params, timestamp handling), signZapRequest (signer validation) Also updates todo-test-coverage-gaps.md with a prioritized, detailed plan covering all remaining untested areas (P0 through P3). https://claude.ai/code/session_01QDsPRh4f31ZpDYqS1kETFV