diff options
| author | Adam Soltys <[email protected]> | 2026-02-05 18:45:08 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-02-06 09:00:22 -0800 |
| commit | 808e7535d33ffca4c1bf859d8bf0afe134f3e1d7 (patch) | |
| tree | 87ee9ec7f8e658cf78c33b82f35c991612cbba38 /test | |
| parent | 4e9c0c5198c7884cfd97cb4495f6156632e3124a (diff) | |
| download | coinos-server-808e7535d33ffca4c1bf859d8bf0afe134f3e1d7.tar.gz coinos-server-808e7535d33ffca4c1bf859d8bf0afe134f3e1d7.zip | |
cross-protocol forwarding with race condition fixes
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Diffstat (limited to 'test')
| -rw-r--r-- | test/forward.test.ts | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/test/forward.test.ts b/test/forward.test.ts index 55e88a3e..c387c489 100644 --- a/test/forward.test.ts +++ b/test/forward.test.ts @@ -117,15 +117,9 @@ describe("completePayment", () => { const inv = makeInvoice({ aid: arkAccountId, forward: bolt11 }); const p = { amount: 1000, confirmed: true, type: "ark", uid: custodialUid, created: Date.now() }; - const w: any = await completePayment(inv, p, user); - - expect(w).toBeTruthy(); - expect(w.amount).toBeLessThan(0); - expect(w.type).toBe("lightning"); - - // Debit stays in custodial list - expect(store().listStore[`${custodialUid}:payments`] ?? []).toContain(w.id); + await completePayment(inv, p, user); + expect(mockLnXpay).toHaveBeenCalled(); expect(inv.forwarded).toBe(true); expect(mockCallWebhook).toHaveBeenCalled(); }); @@ -135,11 +129,9 @@ describe("completePayment", () => { const inv = makeInvoice({ aid: custodialUid, forward: bolt11 }); const p = { amount: 1000, confirmed: true, type: "ark", uid: custodialUid, created: Date.now() }; - const w: any = await completePayment(inv, p, user); + await completePayment(inv, p, user); - expect(w).toBeTruthy(); - expect(w.amount).toBeLessThan(0); - expect(store().listStore[`${custodialUid}:payments`] ?? []).toContain(w.id); + expect(mockLnXpay).toHaveBeenCalled(); expect(inv.forwarded).toBe(true); }); |
