diff options
Diffstat (limited to 'packages/taler-harness/src')
7 files changed, 15 insertions, 48 deletions
diff --git a/packages/taler-harness/src/integrationtests/test-exchange-timetravel.ts b/packages/taler-harness/src/integrationtests/test-exchange-timetravel.ts index efa21e1a0..74ef64234 100644 --- a/packages/taler-harness/src/integrationtests/test-exchange-timetravel.ts +++ b/packages/taler-harness/src/integrationtests/test-exchange-timetravel.ts @@ -23,7 +23,6 @@ import { DenominationPubKey, DenomKeyType, Duration, - durationFromSpec, ExchangeKeysJson, Logger, } from "@gnu-taler/taler-util"; @@ -190,7 +189,7 @@ export async function runExchangeTimetravelTest(t: GlobalTestState) { // into the future. console.log("applying first time travel"); await applyTimeTravelV2( - Duration.toMilliseconds(durationFromSpec({ days: 400 })), + Duration.toMilliseconds(Duration.fromSpec({ days: 400 })), { walletClient, exchange, diff --git a/packages/taler-harness/src/integrationtests/test-merchant-refund-api.ts b/packages/taler-harness/src/integrationtests/test-merchant-refund-api.ts index 1b69b9de6..7ee4c977b 100644 --- a/packages/taler-harness/src/integrationtests/test-merchant-refund-api.ts +++ b/packages/taler-harness/src/integrationtests/test-merchant-refund-api.ts @@ -22,7 +22,6 @@ import { MerchantApiClient, PreparePayResultType, URL, - durationFromSpec, } from "@gnu-taler/taler-util"; import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; import { @@ -59,7 +58,7 @@ async function testRefundApiWithFulfillmentUrl( fulfillment_url: "https://example.com/fulfillment", }, refund_delay: Duration.toTalerProtocolDuration( - durationFromSpec({ minutes: 5 }), + Duration.fromSpec({ minutes: 5 }), ), }); @@ -175,7 +174,7 @@ async function testRefundApiWithFulfillmentMessage( fulfillment_message: "Thank you for buying foobar", }, refund_delay: Duration.toTalerProtocolDuration( - durationFromSpec({ minutes: 5 }), + Duration.fromSpec({ minutes: 5 }), ), }); diff --git a/packages/taler-harness/src/integrationtests/test-refund-auto.ts b/packages/taler-harness/src/integrationtests/test-refund-auto.ts index e8bfecefa..2a2e26ea4 100644 --- a/packages/taler-harness/src/integrationtests/test-refund-auto.ts +++ b/packages/taler-harness/src/integrationtests/test-refund-auto.ts @@ -17,11 +17,7 @@ /** * Imports. */ -import { - Duration, - MerchantApiClient, - durationFromSpec, -} from "@gnu-taler/taler-util"; +import { Duration, MerchantApiClient } from "@gnu-taler/taler-util"; import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; import { GlobalTestState } from "../harness/harness.js"; import { @@ -62,7 +58,7 @@ export async function runRefundAutoTest(t: GlobalTestState) { }, }, refund_delay: Duration.toTalerProtocolDuration( - durationFromSpec({ minutes: 5 }), + Duration.fromSpec({ minutes: 5 }), ), }); diff --git a/packages/taler-harness/src/integrationtests/test-refund-gone.ts b/packages/taler-harness/src/integrationtests/test-refund-gone.ts index 056560eb8..8a661868f 100644 --- a/packages/taler-harness/src/integrationtests/test-refund-gone.ts +++ b/packages/taler-harness/src/integrationtests/test-refund-gone.ts @@ -23,7 +23,6 @@ import { MerchantApiClient, TransactionMajorState, TransactionType, - durationFromSpec, } from "@gnu-taler/taler-util"; import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; import { GlobalTestState } from "../harness/harness.js"; @@ -66,14 +65,14 @@ export async function runRefundGoneTest(t: GlobalTestState) { pay_deadline: AbsoluteTime.toProtocolTimestamp( AbsoluteTime.addDuration( AbsoluteTime.now(), - durationFromSpec({ + Duration.fromSpec({ minutes: 10, }), ), ), }, refund_delay: Duration.toTalerProtocolDuration( - durationFromSpec({ minutes: 1 }), + Duration.fromSpec({ minutes: 1 }), ), }); diff --git a/packages/taler-harness/src/integrationtests/test-refund-incremental.ts b/packages/taler-harness/src/integrationtests/test-refund-incremental.ts index e7e041ce6..8a5d23315 100644 --- a/packages/taler-harness/src/integrationtests/test-refund-incremental.ts +++ b/packages/taler-harness/src/integrationtests/test-refund-incremental.ts @@ -22,7 +22,6 @@ import { Duration, MerchantApiClient, TransactionType, - durationFromSpec, } from "@gnu-taler/taler-util"; import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; import { GlobalTestState, delayMs } from "../harness/harness.js"; @@ -62,7 +61,7 @@ export async function runRefundIncrementalTest(t: GlobalTestState) { fulfillment_url: "taler://fulfillment-success/thx", }, refund_delay: Duration.toTalerProtocolDuration( - durationFromSpec({ minutes: 5 }), + Duration.fromSpec({ minutes: 5 }), ), }); diff --git a/packages/taler-harness/src/integrationtests/test-refund.ts b/packages/taler-harness/src/integrationtests/test-refund.ts index aa245803d..999a9b621 100644 --- a/packages/taler-harness/src/integrationtests/test-refund.ts +++ b/packages/taler-harness/src/integrationtests/test-refund.ts @@ -1,6 +1,6 @@ /* This file is part of GNU Taler - (C) 2020 Taler Systems S.A. + (C) 2020-2024 Taler Systems S.A. GNU Taler is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -19,7 +19,6 @@ */ import { Duration, - durationFromSpec, j2s, MerchantApiClient, NotificationType, @@ -33,9 +32,6 @@ import { withdrawViaBankV2, } from "../harness/helpers.js"; -/** - * Run test for basic, bank-integrated withdrawal. - */ export async function runRefundTest(t: GlobalTestState) { // Set up test environment @@ -67,7 +63,7 @@ export async function runRefundTest(t: GlobalTestState) { fulfillment_url: "taler://fulfillment-success/thx", }, refund_delay: Duration.toTalerProtocolDuration( - durationFromSpec({ minutes: 5 }), + Duration.fromSpec({ minutes: 5 }), ), }); @@ -84,7 +80,7 @@ export async function runRefundTest(t: GlobalTestState) { }); await wallet.client.call(WalletApiOperation.ConfirmPay, { - proposalId: r1.proposalId, + transactionId: r1.transactionId, }); // Check if payment was successful. @@ -115,7 +111,6 @@ export async function runRefundTest(t: GlobalTestState) { console.log(ref); { - // FIXME! const refundFinishedCond = wallet.waitForNotificationCond( (x) => x.type === NotificationType.TransactionStateTransition && @@ -125,7 +120,6 @@ export async function runRefundTest(t: GlobalTestState) { await wallet.client.call(WalletApiOperation.StartRefundQuery, { transactionId: r1.transactionId, }); - await refundFinishedCond; } @@ -150,21 +144,6 @@ export async function runRefundTest(t: GlobalTestState) { tx.type === TransactionType.Payment && tx.refundPending === undefined, ); } - - // FIXME: Test is incomplete without this! - // { - // const refundQueriedCond = wallet.waitForNotificationCond( - // (x) => x.type === NotificationType.RefundQueried, - // ); - // const r3 = await wallet.client.call( - // WalletApiOperation.ApplyRefundFromPurchaseId, - // { - // purchaseId: r1.proposalId, - // }, - // ); - // console.log(r3); - // await refundQueriedCond; - // } } runRefundTest.suites = ["wallet"]; diff --git a/packages/taler-harness/src/integrationtests/test-timetravel-autorefresh.ts b/packages/taler-harness/src/integrationtests/test-timetravel-autorefresh.ts index 98ac7adae..e144683cb 100644 --- a/packages/taler-harness/src/integrationtests/test-timetravel-autorefresh.ts +++ b/packages/taler-harness/src/integrationtests/test-timetravel-autorefresh.ts @@ -20,22 +20,18 @@ import { ConfirmPayResultType, Duration, - durationFromSpec, MerchantApiClient, NotificationType, PreparePayResultType, } from "@gnu-taler/taler-util"; -import { - PendingOperationsResponse, - WalletApiOperation, -} from "@gnu-taler/taler-wallet-core"; +import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; import { makeNoFeeCoinConfig } from "../harness/denomStructures.js"; import { BankService, ExchangeService, - generateRandomPayto, GlobalTestState, MerchantService, + generateRandomPayto, setupDb, } from "../harness/harness.js"; import { @@ -135,7 +131,7 @@ export async function runTimetravelAutorefreshTest(t: GlobalTestState) { // into the future. console.log("applying first time travel"); await applyTimeTravelV2( - Duration.toMilliseconds(durationFromSpec({ days: 400 })), + Duration.toMilliseconds(Duration.fromSpec({ days: 400 })), { walletClient, exchange, @@ -167,7 +163,7 @@ export async function runTimetravelAutorefreshTest(t: GlobalTestState) { // into the future. console.log("applying second time travel"); await applyTimeTravelV2( - Duration.toMilliseconds(durationFromSpec({ years: 2, months: 6 })), + Duration.toMilliseconds(Duration.fromSpec({ years: 2, months: 6 })), { walletClient, exchange, |