diff options
author | Florian Dold <florian@dold.me> | 2023-08-29 09:02:16 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2023-08-29 09:03:19 +0200 |
commit | b13bd85215ad64e7a2764ac7e7fee5945ffa1c07 (patch) | |
tree | 70643c7e76baeb9f61857add603dc381b6f03766 /packages/taler-harness/src/integrationtests/test-paywall-flow.ts | |
parent | 8941f29cb457f86235b73f125e77a88cb762f353 (diff) | |
download | wallet-core-b13bd85215ad64e7a2764ac7e7fee5945ffa1c07.tar.xz |
taler-harness: remove axios usage, renovate some tests
Diffstat (limited to 'packages/taler-harness/src/integrationtests/test-paywall-flow.ts')
-rw-r--r-- | packages/taler-harness/src/integrationtests/test-paywall-flow.ts | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/packages/taler-harness/src/integrationtests/test-paywall-flow.ts b/packages/taler-harness/src/integrationtests/test-paywall-flow.ts index b0477a049..5f63d4fac 100644 --- a/packages/taler-harness/src/integrationtests/test-paywall-flow.ts +++ b/packages/taler-harness/src/integrationtests/test-paywall-flow.ts @@ -17,7 +17,7 @@ /** * Imports. */ -import { GlobalTestState, MerchantPrivateApi } from "../harness/harness.js"; +import { GlobalTestState, MerchantPrivateApi, harnessHttpLib } from "../harness/harness.js"; import { PreparePayResultType, codecForMerchantOrderStatusUnpaid, @@ -29,12 +29,6 @@ import { createSimpleTestkudosEnvironmentV2, withdrawViaBankV2, } from "../harness/helpers.js"; -import { createPlatformHttpLib } from "@gnu-taler/taler-util/http"; - -const httpLib = createPlatformHttpLib({ - allowHttp: true, - enableThrottling: false, -}); /** * Run test for basic, bank-integrated withdrawal. @@ -47,13 +41,15 @@ export async function runPaywallFlowTest(t: GlobalTestState) { // Withdraw digital cash into the wallet. - await withdrawViaBankV2(t, { + const wres = await withdrawViaBankV2(t, { walletClient, bank, exchange, amount: "TESTKUDOS:20", }); + await wres.withdrawalFinishedCond; + /** * ========================================================================= * Create an order and let the wallet pay under a session ID @@ -86,7 +82,7 @@ export async function runPaywallFlowTest(t: GlobalTestState) { t.assertTrue(orderStatus.already_paid_order_id === undefined); let publicOrderStatusUrl = new URL(orderStatus.order_status_url); - let publicOrderStatusResp = await httpLib.fetch(publicOrderStatusUrl.href); + let publicOrderStatusResp = await harnessHttpLib.fetch(publicOrderStatusUrl.href); if (publicOrderStatusResp.status != 402) { throw Error( @@ -112,7 +108,7 @@ export async function runPaywallFlowTest(t: GlobalTestState) { const proposalId = preparePayResp.proposalId; console.log("requesting", publicOrderStatusUrl.href); - publicOrderStatusResp = await httpLib.fetch(publicOrderStatusUrl.href); + publicOrderStatusResp = await harnessHttpLib.fetch(publicOrderStatusUrl.href); console.log("response body", publicOrderStatusResp.json()); if (publicOrderStatusResp.status != 402) { throw Error( @@ -129,7 +125,7 @@ export async function runPaywallFlowTest(t: GlobalTestState) { }); t.assertTrue(confirmPayRes.type === ConfirmPayResultType.Done); - publicOrderStatusResp = await httpLib.fetch(publicOrderStatusUrl.href); + publicOrderStatusResp = await harnessHttpLib.fetch(publicOrderStatusUrl.href); console.log(publicOrderStatusResp.json()); @@ -231,7 +227,7 @@ export async function runPaywallFlowTest(t: GlobalTestState) { console.log("requesting public status", publicOrderStatusUrl); // Ask the order status of the claimed-but-unpaid order - publicOrderStatusResp = await httpLib.fetch(publicOrderStatusUrl.href); + publicOrderStatusResp = await harnessHttpLib.fetch(publicOrderStatusUrl.href); if (publicOrderStatusResp.status != 402) { throw Error(`expected status 402, but got ${publicOrderStatusResp.status}`); |