aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-harness/src/integrationtests/test-merchant-spec-public-orders.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2023-09-05 10:46:06 +0200
committerFlorian Dold <florian@dold.me>2023-09-05 10:48:41 +0200
commita60a1d867cfe6a12f1e6fadfa037f022e9385107 (patch)
treebc77a92b327cd0e4933fa4b3fe15f1c775e24235 /packages/taler-harness/src/integrationtests/test-merchant-spec-public-orders.ts
parente1d86816a7c07cb8ca2d54676d5cdbbe513f2ba7 (diff)
downloadwallet-core-a60a1d867cfe6a12f1e6fadfa037f022e9385107.tar.xz
harness: remove deprecated testing APIs
Diffstat (limited to 'packages/taler-harness/src/integrationtests/test-merchant-spec-public-orders.ts')
-rw-r--r--packages/taler-harness/src/integrationtests/test-merchant-spec-public-orders.ts61
1 files changed, 37 insertions, 24 deletions
diff --git a/packages/taler-harness/src/integrationtests/test-merchant-spec-public-orders.ts b/packages/taler-harness/src/integrationtests/test-merchant-spec-public-orders.ts
index e959e813b..08c9d4bb2 100644
--- a/packages/taler-harness/src/integrationtests/test-merchant-spec-public-orders.ts
+++ b/packages/taler-harness/src/integrationtests/test-merchant-spec-public-orders.ts
@@ -35,8 +35,9 @@ import {
harnessHttpLib,
} from "../harness/harness.js";
import {
- createSimpleTestkudosEnvironment,
- withdrawViaBank,
+ createSimpleTestkudosEnvironmentV2,
+ createWalletDaemonWithClient,
+ withdrawViaBankV2,
} from "../harness/helpers.js";
interface Context {
@@ -52,10 +53,18 @@ async function testWithClaimToken(
t: GlobalTestState,
c: Context,
): Promise<void> {
- const wallet = new WalletCli(t, "withclaimtoken");
+ const { walletClient } = await createWalletDaemonWithClient(t, {
+ name: "wct",
+ });
const { bank, exchange } = c;
const { merchant, merchantBaseUrl } = c;
- await withdrawViaBank(t, { wallet, bank, exchange, amount: "TESTKUDOS:20" });
+ const wres = await withdrawViaBankV2(t, {
+ walletClient,
+ bank,
+ exchange,
+ amount: "TESTKUDOS:20",
+ });
+ await wres.withdrawalFinishedCond;
const sessionId = "mysession";
const orderResp = await MerchantPrivateApi.createOrder(merchant, "default", {
order: {
@@ -104,7 +113,7 @@ async function testWithClaimToken(
console.log(r);
}
- const preparePayResp = await wallet.client.call(
+ const preparePayResp = await walletClient.call(
WalletApiOperation.PreparePayForUri,
{
talerPayUri,
@@ -166,12 +175,9 @@ async function testWithClaimToken(
t.assertDeepEqual(httpResp.status, 202);
}
- const confirmPayRes = await wallet.client.call(
- WalletApiOperation.ConfirmPay,
- {
- proposalId: proposalId,
- },
- );
+ const confirmPayRes = await walletClient.call(WalletApiOperation.ConfirmPay, {
+ proposalId: proposalId,
+ });
t.assertTrue(confirmPayRes.type === ConfirmPayResultType.Done);
@@ -238,7 +244,7 @@ async function testWithClaimToken(
t.assertDeepEqual(httpResp.status, 200);
}
- const confirmPayRes2 = await wallet.client.call(
+ const confirmPayRes2 = await walletClient.call(
WalletApiOperation.ConfirmPay,
{
proposalId: proposalId,
@@ -307,11 +313,19 @@ async function testWithoutClaimToken(
t: GlobalTestState,
c: Context,
): Promise<void> {
- const wallet = new WalletCli(t, "withoutct");
+ const { walletClient } = await createWalletDaemonWithClient(t, {
+ name: "wnoct",
+ });
const sessionId = "mysession2";
const { bank, exchange } = c;
const { merchant, merchantBaseUrl } = c;
- await withdrawViaBank(t, { wallet, bank, exchange, amount: "TESTKUDOS:20" });
+ const wres = await withdrawViaBankV2(t, {
+ walletClient,
+ bank,
+ exchange,
+ amount: "TESTKUDOS:20",
+ });
+ await wres.withdrawalFinishedCond;
const orderResp = await MerchantPrivateApi.createOrder(merchant, "default", {
order: {
summary: "Buy me!",
@@ -356,7 +370,7 @@ async function testWithoutClaimToken(
console.log(r);
}
- const preparePayResp = await wallet.client.call(
+ const preparePayResp = await walletClient.call(
WalletApiOperation.PreparePayForUri,
{
talerPayUri,
@@ -422,12 +436,9 @@ async function testWithoutClaimToken(
t.assertDeepEqual(httpResp.status, 402);
}
- const confirmPayRes = await wallet.client.call(
- WalletApiOperation.ConfirmPay,
- {
- proposalId: proposalId,
- },
- );
+ const confirmPayRes = await walletClient.call(WalletApiOperation.ConfirmPay, {
+ proposalId: proposalId,
+ });
t.assertTrue(confirmPayRes.type === ConfirmPayResultType.Done);
@@ -492,7 +503,7 @@ async function testWithoutClaimToken(
t.assertDeepEqual(httpResp.status, 200);
}
- const confirmPayRes2 = await wallet.client.call(
+ const confirmPayRes2 = await walletClient.call(
WalletApiOperation.ConfirmPay,
{
proposalId: proposalId,
@@ -564,7 +575,7 @@ async function testWithoutClaimToken(
* specification of the endpoint.
*/
export async function runMerchantSpecPublicOrdersTest(t: GlobalTestState) {
- const { bank, exchange, merchant } = await createSimpleTestkudosEnvironment(
+ const { bank, exchange, merchant } = await createSimpleTestkudosEnvironmentV2(
t,
);
@@ -572,7 +583,9 @@ export async function runMerchantSpecPublicOrdersTest(t: GlobalTestState) {
const merchantBaseUrl = merchant.makeInstanceBaseUrl();
{
- const httpResp = await httpLib.fetch(new URL("config", merchantBaseUrl).href);
+ const httpResp = await httpLib.fetch(
+ new URL("config", merchantBaseUrl).href,
+ );
const r = await httpResp.json();
console.log(r);
t.assertDeepEqual(r.currency, "TESTKUDOS");