aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-cli
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2021-08-08 13:35:35 +0200
committerFlorian Dold <florian@dold.me>2021-08-08 13:35:35 +0200
commit425ea0fbca5a954fc9f9c13e7b19d72aed7efe25 (patch)
tree5de865f985596c43e2fd05aa1d12a41ae570e5de /packages/taler-wallet-cli
parent5f06ce16be6ba3ae9fb86fec5663c5d49b21fa77 (diff)
tests: logging for test-paywall-flow
Diffstat (limited to 'packages/taler-wallet-cli')
-rw-r--r--packages/taler-wallet-cli/src/integrationtests/test-paywall-flow.ts18
1 files changed, 10 insertions, 8 deletions
diff --git a/packages/taler-wallet-cli/src/integrationtests/test-paywall-flow.ts b/packages/taler-wallet-cli/src/integrationtests/test-paywall-flow.ts
index 9312fb9a6..25c8862cc 100644
--- a/packages/taler-wallet-cli/src/integrationtests/test-paywall-flow.ts
+++ b/packages/taler-wallet-cli/src/integrationtests/test-paywall-flow.ts
@@ -23,6 +23,7 @@ import {
PreparePayResultType,
codecForMerchantOrderStatusUnpaid,
ConfirmPayResultType,
+ URL,
} from "@gnu-taler/taler-util";
import axios from "axios";
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
@@ -74,9 +75,9 @@ export async function runPaywallFlowTest(t: GlobalTestState) {
const talerPayUriOne = orderStatus.taler_pay_uri;
t.assertTrue(orderStatus.already_paid_order_id === undefined);
- let publicOrderStatusUrl = orderStatus.order_status_url;
+ let publicOrderStatusUrl = new URL(orderStatus.order_status_url);
- let publicOrderStatusResp = await axios.get(publicOrderStatusUrl, {
+ let publicOrderStatusResp = await axios.get(publicOrderStatusUrl.href, {
validateStatus: () => true,
});
@@ -103,10 +104,11 @@ export async function runPaywallFlowTest(t: GlobalTestState) {
const proposalId = preparePayResp.proposalId;
- publicOrderStatusResp = await axios.get(publicOrderStatusUrl, {
+ console.log("requesting", publicOrderStatusUrl.href);
+ publicOrderStatusResp = await axios.get(publicOrderStatusUrl.href, {
validateStatus: () => true,
});
-
+ console.log("response body", publicOrderStatusResp.data);
if (publicOrderStatusResp.status != 402) {
throw Error(
`expected status 402 (after claiming), but got ${publicOrderStatusResp.status}`,
@@ -126,7 +128,7 @@ export async function runPaywallFlowTest(t: GlobalTestState) {
t.assertTrue(confirmPayRes.type === ConfirmPayResultType.Done);
- publicOrderStatusResp = await axios.get(publicOrderStatusUrl, {
+ publicOrderStatusResp = await axios.get(publicOrderStatusUrl.href, {
validateStatus: () => true,
});
@@ -192,7 +194,7 @@ export async function runPaywallFlowTest(t: GlobalTestState) {
t.assertTrue(orderStatus.order_status === "unpaid");
t.assertTrue(orderStatus.already_paid_order_id === undefined);
- publicOrderStatusUrl = orderStatus.order_status_url;
+ publicOrderStatusUrl = new URL(orderStatus.order_status_url);
// Here the re-purchase detection should kick in,
// and the wallet should re-pay for the old order
@@ -230,7 +232,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 axios.get(publicOrderStatusUrl, {
+ publicOrderStatusResp = await axios.get(publicOrderStatusUrl.href, {
validateStatus: () => true,
});
@@ -247,4 +249,4 @@ export async function runPaywallFlowTest(t: GlobalTestState) {
t.assertTrue(pubUnpaidStatus.already_paid_order_id === firstOrderId);
}
-runPaywallFlowTest.suites = ["wallet"];
+runPaywallFlowTest.suites = ["merchant", "wallet"];