aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-harness
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2023-06-21 06:59:34 +0200
committerFlorian Dold <florian@dold.me>2023-06-21 06:59:40 +0200
commit7dcfd02dae23fe2a6249893ae19ab59b8b5a09f5 (patch)
tree7a0c828b54e0745f7ac5ddda91e34a69e56f4601 /packages/taler-harness
parent34e2fd51e038d26c9ea1c0c6770148640669518f (diff)
downloadwallet-core-7dcfd02dae23fe2a6249893ae19ab59b8b5a09f5.tar.xz
harness: fix exchange base URL in tests with fault injection
Diffstat (limited to 'packages/taler-harness')
-rw-r--r--packages/taler-harness/src/harness/helpers.ts10
-rw-r--r--packages/taler-harness/src/integrationtests/test-exchange-management.ts6
-rw-r--r--packages/taler-harness/src/integrationtests/test-merchant-exchange-confusion.ts5
-rw-r--r--packages/taler-harness/src/integrationtests/test-payment-fault.ts4
4 files changed, 22 insertions, 3 deletions
diff --git a/packages/taler-harness/src/harness/helpers.ts b/packages/taler-harness/src/harness/helpers.ts
index bc2f573e9..fd6e9aa2e 100644
--- a/packages/taler-harness/src/harness/helpers.ts
+++ b/packages/taler-harness/src/harness/helpers.ts
@@ -406,6 +406,11 @@ export async function createFaultInjectedMerchantTestkudosEnvironment(
const faultyMerchant = new FaultInjectedMerchantService(t, merchant, 9083);
const faultyExchange = new FaultInjectedExchangeService(t, exchange, 9081);
+ // Base URL must contain port that the proxy is listening on.
+ await exchange.modifyConfig(async (config) => {
+ config.setString("exchange", "base_url", "http://localhost:9081/");
+ });
+
const exchangeBankAccount = await bank.createExchangeAccount(
"myexchange",
"x",
@@ -546,8 +551,9 @@ export async function withdrawViaBankV2(
},
);
- const withdrawalFinishedCond = wallet.waitForNotificationCond((x) =>
- x.type === NotificationType.TransactionStateTransition &&
+ const withdrawalFinishedCond = wallet.waitForNotificationCond(
+ (x) =>
+ x.type === NotificationType.TransactionStateTransition &&
x.newTxState.major === TransactionMajorState.Done &&
x.transactionId === acceptRes.transactionId,
);
diff --git a/packages/taler-harness/src/integrationtests/test-exchange-management.ts b/packages/taler-harness/src/integrationtests/test-exchange-management.ts
index 6b63c3741..c67f861e1 100644
--- a/packages/taler-harness/src/integrationtests/test-exchange-management.ts
+++ b/packages/taler-harness/src/integrationtests/test-exchange-management.ts
@@ -44,7 +44,7 @@ import {
import { defaultCoinConfig } from "../harness/denomStructures.js";
/**
- * Test if the wallet handles outdated exchange versions correct.y
+ * Test if the wallet handles outdated exchange versions correctly.
*/
export async function runExchangeManagementTest(
t: GlobalTestState,
@@ -81,6 +81,10 @@ export async function runExchangeManagementTest(
exchange.addBankAccount("1", exchangeBankAccount);
const faultyExchange = new FaultInjectedExchangeService(t, exchange, 8091);
+ // Base URL must contain port that the proxy is listening on.
+ await exchange.modifyConfig(async (config) => {
+ config.setString("exchange", "base_url", "http://localhost:8091/");
+ });
bank.setSuggestedExchange(
faultyExchange,
diff --git a/packages/taler-harness/src/integrationtests/test-merchant-exchange-confusion.ts b/packages/taler-harness/src/integrationtests/test-merchant-exchange-confusion.ts
index 30ab1cd4b..2fccd0b97 100644
--- a/packages/taler-harness/src/integrationtests/test-merchant-exchange-confusion.ts
+++ b/packages/taler-harness/src/integrationtests/test-merchant-exchange-confusion.ts
@@ -79,6 +79,11 @@ export async function createConfusedMerchantTestkudosEnvironment(
const faultyMerchant = new FaultInjectedMerchantService(t, merchant, 9083);
const faultyExchange = new FaultInjectedExchangeService(t, exchange, 9081);
+ // Base URL must contain port that the proxy is listening on.
+ await exchange.modifyConfig(async (config) => {
+ config.setString("exchange", "base_url", "http://localhost:9081/");
+ });
+
const exchangeBankAccount = await bank.createExchangeAccount(
"myexchange",
"x",
diff --git a/packages/taler-harness/src/integrationtests/test-payment-fault.ts b/packages/taler-harness/src/integrationtests/test-payment-fault.ts
index dea538e35..209830187 100644
--- a/packages/taler-harness/src/integrationtests/test-payment-fault.ts
+++ b/packages/taler-harness/src/integrationtests/test-payment-fault.ts
@@ -84,6 +84,10 @@ export async function runPaymentFaultTest(t: GlobalTestState) {
await exchange.pingUntilAvailable();
const faultyExchange = new FaultInjectedExchangeService(t, exchange, 8091);
+ // Base URL must contain port that the proxy is listening on.
+ await exchange.modifyConfig(async (config) => {
+ config.setString("exchange", "base_url", "http://localhost:8091/");
+ });
// Print all requests to the exchange
faultyExchange.faultProxy.addFault({