gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-core] branch master updated: tag test properly


From: gnunet
Subject: [taler-wallet-core] branch master updated: tag test properly
Date: Fri, 06 Aug 2021 18:51:42 +0200

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository wallet-core.

The following commit(s) were added to refs/heads/master by this push:
     new 20ffa834 tag test properly
20ffa834 is described below

commit 20ffa834d8e1b135b308e27d2b655e6868ce1872
Author: Florian Dold <florian@dold.me>
AuthorDate: Fri Aug 6 18:51:37 2021 +0200

    tag test properly
---
 .../src/integrationtests/libeufin.ts               | 13 +++----
 .../test-libeufin-api-bankaccount.ts               |  6 +--
 .../src/integrationtests/test-libeufin-basic.ts    |  1 -
 .../integrationtests/test-merchant-longpolling.ts  | 44 ++++++++++++++++------
 4 files changed, 42 insertions(+), 22 deletions(-)

diff --git a/packages/taler-wallet-cli/src/integrationtests/libeufin.ts 
b/packages/taler-wallet-cli/src/integrationtests/libeufin.ts
index a30ce97a..5e524af1 100644
--- a/packages/taler-wallet-cli/src/integrationtests/libeufin.ts
+++ b/packages/taler-wallet-cli/src/integrationtests/libeufin.ts
@@ -168,9 +168,9 @@ export interface LibeufinSandboxAddIncomingRequest {
   creditorIban: string;
   creditorBic: string;
   creditorName: string;
-  debitorIban: string;
-  debitorBic: string;
-  debitorName: string;
+  debtorIban: string;
+  debtorBic: string;
+  debtorName: string;
   subject: string;
   amount: string;
   currency: string;
@@ -332,7 +332,6 @@ export interface SimulateIncomingTransactionRequest {
    * Decimal amount without currency.
    */
   amount: string;
-  currency: string;
 }
 
 /**
@@ -798,9 +797,9 @@ export namespace LibeufinSandboxApi {
       creditorIban: creditorBundle.ebicsBankAccount.iban,
       creditorBic: creditorBundle.ebicsBankAccount.bic,
       creditorName: creditorBundle.ebicsBankAccount.name,
-      debitorIban: debitorBundle.ebicsBankAccount.iban,
-      debitorBic: debitorBundle.ebicsBankAccount.bic,
-      debitorName: debitorBundle.ebicsBankAccount.name,
+      debtorIban: debitorBundle.ebicsBankAccount.iban,
+      debtorBic: debitorBundle.ebicsBankAccount.bic,
+      debtorName: debitorBundle.ebicsBankAccount.name,
       subject: subject,
       amount: amount,
       currency: currency,
diff --git 
a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-bankaccount.ts
 
b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-bankaccount.ts
index 3c391225..2fbc952e 100644
--- 
a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-bankaccount.ts
+++ 
b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-api-bankaccount.ts
@@ -93,9 +93,9 @@ export async function runLibeufinApiBankaccountTest(t: 
GlobalTestState) {
     creditorIban: "DE71500105179674997361",
     creditorBic: "BELADEBEXXX",
     creditorName: "mock",
-    debitorIban: "DE84500105176881385584",
-    debitorBic: "BELADEBEXXX",
-    debitorName: "mock2",
+    debtorIban: "DE84500105176881385584",
+    debtorBic: "BELADEBEXXX",
+    debtorName: "mock2",
     subject: "mock subject",
     currency: "EUR",
     amount: "1",
diff --git 
a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-basic.ts 
b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-basic.ts
index 34525844..48096bcb 100644
--- a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-basic.ts
+++ b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-basic.ts
@@ -257,7 +257,6 @@ export async function runLibeufinBasicTest(t: 
GlobalTestState) {
     "exchangeacct",
     {
       amount: "15.00",
-      currency: "EUR",
       debtorBic: customerBic,
       debtorIban: customerIban,
       debtorName: "Jane Customer",
diff --git 
a/packages/taler-wallet-cli/src/integrationtests/test-merchant-longpolling.ts 
b/packages/taler-wallet-cli/src/integrationtests/test-merchant-longpolling.ts
index d9178763..6516327c 100644
--- 
a/packages/taler-wallet-cli/src/integrationtests/test-merchant-longpolling.ts
+++ 
b/packages/taler-wallet-cli/src/integrationtests/test-merchant-longpolling.ts
@@ -23,7 +23,7 @@ import {
   PreparePayResultType,
   codecForMerchantOrderStatusUnpaid,
   ConfirmPayResultType,
-  URL
+  URL,
 } from "@gnu-taler/taler-util";
 import axios from "axios";
 import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
@@ -60,10 +60,9 @@ export async function runMerchantLongpollingTest(t: 
GlobalTestState) {
       amount: "TESTKUDOS:5",
       fulfillment_url: "https://example.com/article42";,
     },
+    create_token: false,
   });
 
-  const firstOrderId = orderResp.order_id;
-
   let orderStatus = await MerchantPrivateApi.queryPrivateOrderStatus(merchant, 
{
     orderId: orderResp.order_id,
     sessionId: "mysession-one",
@@ -74,16 +73,31 @@ export async function runMerchantLongpollingTest(t: 
GlobalTestState) {
   t.assertTrue(orderStatus.already_paid_order_id === undefined);
   let publicOrderStatusUrl = new URL(orderStatus.order_status_url);
 
-  // Wait for half a second seconds!
+  // First, request order status without longpolling
+  {
+    console.log("requesting", publicOrderStatusUrl.href);
+    let publicOrderStatusResp = await axios.get(publicOrderStatusUrl.href, {
+      validateStatus: () => true,
+    });
+
+    if (publicOrderStatusResp.status != 402) {
+      throw Error(
+        `expected status 402 (before claiming, no long polling), but got 
${publicOrderStatusResp.status}`,
+      );
+    }
+  }
+
+  // Now do long-polling for half a second!
   publicOrderStatusUrl.searchParams.set("timeout_ms", "500");
 
+  console.log("requesting", publicOrderStatusUrl.href);
   let publicOrderStatusResp = await axios.get(publicOrderStatusUrl.href, {
     validateStatus: () => true,
   });
 
   if (publicOrderStatusResp.status != 402) {
     throw Error(
-      `expected status 402 (before claiming), but got 
${publicOrderStatusResp.status}`,
+      `expected status 402 (before claiming, with long-polling), but got 
${publicOrderStatusResp.status}`,
     );
   }
 
@@ -99,12 +113,6 @@ export async function runMerchantLongpollingTest(t: 
GlobalTestState) {
    * =========================================================================
    */
 
-  publicOrderStatusUrl.searchParams.set("timeout_ms", "5000");
-
-  let publicOrderStatusPromise = axios.get(publicOrderStatusUrl.href, {
-    validateStatus: () => true,
-  });
-
   let preparePayResp = await wallet.client.call(
     WalletApiOperation.PreparePayForUri,
     {
@@ -114,6 +122,18 @@ export async function runMerchantLongpollingTest(t: 
GlobalTestState) {
 
   t.assertTrue(preparePayResp.status === PreparePayResultType.PaymentPossible);
 
+  publicOrderStatusUrl.searchParams.set("timeout_ms", "5000");
+  publicOrderStatusUrl.searchParams.set(
+    "h_contract",
+    preparePayResp.contractTermsHash,
+  );
+
+  let publicOrderStatusPromise = axios.get(publicOrderStatusUrl.href, {
+    validateStatus: () => true,
+  });
+
+  t.assertTrue(preparePayResp.status === PreparePayResultType.PaymentPossible);
+
   const proposalId = preparePayResp.proposalId;
 
   publicOrderStatusResp = await publicOrderStatusPromise;
@@ -137,3 +157,5 @@ export async function runMerchantLongpollingTest(t: 
GlobalTestState) {
 
   t.assertTrue(confirmPayRes.type === ConfirmPayResultType.Done);
 }
+
+runMerchantLongpollingTest.suites = ["merchant"];

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]