aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-harness/src/integrationtests/test-refund.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-harness/src/integrationtests/test-refund.ts')
-rw-r--r--packages/taler-harness/src/integrationtests/test-refund.ts20
1 files changed, 18 insertions, 2 deletions
diff --git a/packages/taler-harness/src/integrationtests/test-refund.ts b/packages/taler-harness/src/integrationtests/test-refund.ts
index aeeb91f38..0d95ea035 100644
--- a/packages/taler-harness/src/integrationtests/test-refund.ts
+++ b/packages/taler-harness/src/integrationtests/test-refund.ts
@@ -23,6 +23,7 @@ import {
MerchantApiClient,
NotificationType,
TransactionMajorState,
+ TransactionType,
} from "@gnu-taler/taler-util";
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
import { GlobalTestState } from "../harness/harness.js";
@@ -58,7 +59,6 @@ export async function runRefundTest(t: GlobalTestState) {
await withdrawalRes.withdrawalFinishedCond;
// Set up order.
-
const orderResp = await merchantClient.createOrder({
order: {
summary: "Buy me!",
@@ -94,6 +94,15 @@ export async function runRefundTest(t: GlobalTestState) {
t.assertTrue(orderStatus.order_status === "paid");
+
+ {
+ const tx = await wallet.client.call(WalletApiOperation.GetTransactionById, {
+ transactionId: r1.transactionId,
+ });
+
+ t.assertTrue(tx.type === TransactionType.Payment && tx.refundPending === undefined)
+ }
+
const ref = await merchantClient.giveRefund({
amount: "TESTKUDOS:5",
instance: "default",
@@ -113,7 +122,6 @@ export async function runRefundTest(t: GlobalTestState) {
const r = await wallet.client.call(WalletApiOperation.StartRefundQuery, {
transactionId: r1.transactionId,
});
- console.log(r);
await refundFinishedCond;
}
@@ -127,6 +135,14 @@ export async function runRefundTest(t: GlobalTestState) {
console.log(JSON.stringify(r2, undefined, 2));
}
+ {
+ const tx = await wallet.client.call(WalletApiOperation.GetTransactionById, {
+ transactionId: r1.transactionId,
+ });
+
+ t.assertTrue(tx.type === TransactionType.Payment && tx.refundPending === undefined)
+ }
+
// FIXME: Test is incomplete without this!
// {
// const refundQueriedCond = wallet.waitForNotificationCond(