diff options
author | Florian Dold <florian@dold.me> | 2020-11-03 15:56:02 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2020-11-03 15:56:02 +0100 |
commit | ca343e4e0037cd986b3115079d370e61fc5897ce (patch) | |
tree | ae5ebf8fa6fdc8704272eb94151dd3f086413ec9 /packages/taler-integrationtests/src/test-claim-loop.ts | |
parent | e259d109efd998d0ff6197123a47b83bfe274680 (diff) |
fix broken integration tests due to merchant API changes
Diffstat (limited to 'packages/taler-integrationtests/src/test-claim-loop.ts')
-rw-r--r-- | packages/taler-integrationtests/src/test-claim-loop.ts | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/packages/taler-integrationtests/src/test-claim-loop.ts b/packages/taler-integrationtests/src/test-claim-loop.ts index 22a04b7df..da8f7d45d 100644 --- a/packages/taler-integrationtests/src/test-claim-loop.ts +++ b/packages/taler-integrationtests/src/test-claim-loop.ts @@ -24,11 +24,13 @@ import { WalletCli, } from "./harness"; import { createSimpleTestkudosEnvironment, withdrawViaBank } from "./helpers"; -import { PreparePayResultType, TalerErrorCode } from "taler-wallet-core"; import { URL } from "url" /** - * Run test for basic, bank-integrated withdrawal. + * Run test for the merchant's order lifecycle. + * + * FIXME: Is this test still necessary? We initially wrote if to confirm/document + * assumptions about how the merchant should work. */ runTest(async (t: GlobalTestState) => { // Set up test environment @@ -55,6 +57,7 @@ runTest(async (t: GlobalTestState) => { let orderStatusBefore = await MerchantPrivateApi.queryPrivateOrderStatus(merchant, { orderId: orderResp.order_id, }); + t.assertTrue(orderStatusBefore.order_status === "unpaid"); let statusUrlBefore = new URL(orderStatusBefore.order_status_url); // Make wallet claim the unpaid order. @@ -68,17 +71,7 @@ runTest(async (t: GlobalTestState) => { let orderStatusAfter = await MerchantPrivateApi.queryPrivateOrderStatus(merchant, { orderId: orderResp.order_id, }); - let statusUrlAfter = new URL(orderStatusAfter.order_status_url) - - let tokenBefore = statusUrlBefore.searchParams.get("token") - let tokenAfter = statusUrlAfter.searchParams.get("token") - let hashContractAfter = statusUrlAfter.searchParams.get("h_contract") - - // after claiming the contract, we either want its hash in the - // status url, or at least see again its token in the status url. - t.assertTrue( - (hashContractAfter !== null) || (tokenBefore === tokenAfter) - ) + t.assertTrue(orderStatusAfter.order_status === "claimed"); await t.shutdown(); }); |