commit 426e2f3170de3ed41fa857661753435bd962b746 parent bda2474d19eea56468c56f204ec26e70807945f5 Author: Sebastian <sebasjm@gmail.com> Date: Sun, 4 Feb 2024 17:02:39 -0300 update intragration test to use non-deprecated acceptReward request Diffstat:
3 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/packages/taler-harness/src/integrationtests/test-tipping.ts b/packages/taler-harness/src/integrationtests/test-tipping.ts @@ -23,6 +23,7 @@ import { TransactionMajorState, WireGatewayApiClient, AmountString, + TransactionIdStr, } from "@gnu-taler/taler-util"; import { WalletApiOperation, @@ -109,7 +110,7 @@ export async function runTippingTest(t: GlobalTestState) { t.assertAmountEquals(ptr.rewardAmountEffective, "TESTKUDOS:4.85"); await walletClient.call(WalletApiOperation.AcceptReward, { - walletRewardId: ptr.walletRewardId, + transactionId: ptr.transactionId, }); await walletClient.call( diff --git a/packages/taler-wallet-webextension/src/cta/Reward/state.ts b/packages/taler-wallet-webextension/src/cta/Reward/state.ts @@ -14,7 +14,7 @@ GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> */ -import { Amounts } from "@gnu-taler/taler-util"; +import { Amounts, TransactionIdStr } from "@gnu-taler/taler-util"; import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; import { alertFromError, useAlertContext } from "../../context/alert.js"; import { useBackendContext } from "../../context/backend.js"; @@ -63,8 +63,9 @@ export function useComponentState({ const { tip } = tipInfo.response; const doAccept = async (): Promise<void> => { + const res = await api.wallet.call(WalletApiOperation.AcceptReward, { - walletRewardId: tip.transactionId, + transactionId: tip.transactionId, }); //FIX: this may not be seen since we are moving to the success also diff --git a/packages/taler-wallet-webextension/src/cta/Reward/test.ts b/packages/taler-wallet-webextension/src/cta/Reward/test.ts @@ -19,7 +19,7 @@ * @author Sebastian Javier Marchano (sebasjm) */ -import { AmountString, Amounts } from "@gnu-taler/taler-util"; +import { AmountString, Amounts, TransactionIdStr } from "@gnu-taler/taler-util"; import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; import { expect } from "chai"; import * as tests from "@gnu-taler/web-util/testing"; @@ -68,7 +68,7 @@ describe("Tip CTA states", () => { merchantBaseUrl: "merchant url", rewardAmountEffective: "EUR:1" as AmountString, walletRewardId: "tip_id", - transactionId: "txn:tip:ABC1234", + transactionId: "txn:tip:ABC1234" as TransactionIdStr, expirationTimestamp: { t_s: 1, }, @@ -112,7 +112,7 @@ describe("Tip CTA states", () => { merchantBaseUrl: "merchant url", rewardAmountEffective: "EUR:1" as AmountString, walletRewardId: "tip_id", - transactionId: "txn:tip:ABC1234", + transactionId: "txn:tip:ABC1234" as TransactionIdStr, expirationTimestamp: { t_s: 1, }, @@ -142,7 +142,7 @@ describe("Tip CTA states", () => { merchantBaseUrl: "merchant url", rewardAmountEffective: "EUR:1" as AmountString, walletRewardId: "tip_id", - transactionId: "txn:tip:ABC1234", + transactionId: "txn:tip:ABC1234" as TransactionIdStr, accepted: false, expirationTimestamp: { t_s: 1, @@ -190,7 +190,7 @@ describe("Tip CTA states", () => { merchantBaseUrl: "merchant url", rewardAmountEffective: "EUR:1" as AmountString, walletRewardId: "tip_id", - transactionId: "txn:tip:ABC1234", + transactionId: "txn:tip:ABC1234" as TransactionIdStr, expirationTimestamp: { t_s: 1, },