taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit 9e07bc99639b1ddeb401b463a2a658caeb79f487
parent 2f945b2aebf3378496c8be3ef48a16253dde3358
Author: Florian Dold <florian@dold.me>
Date:   Fri, 13 Aug 2021 14:28:54 +0200

merchant spec: more checks

Diffstat:
Mpackages/taler-wallet-cli/src/integrationtests/test-merchant-spec-public-orders.ts | 17++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/packages/taler-wallet-cli/src/integrationtests/test-merchant-spec-public-orders.ts b/packages/taler-wallet-cli/src/integrationtests/test-merchant-spec-public-orders.ts @@ -254,7 +254,7 @@ export async function runMerchantSpecPublicOrdersTest(t: GlobalTestState) { t.assertDeepEqual(httpResp.status, 200); } - // paid, access with correct claim token + // paid, access with correct claim token, JSON { const url = new URL(`orders/${orderId}`, merchantBaseUrl); url.searchParams.set("token", claimToken); @@ -262,6 +262,21 @@ export async function runMerchantSpecPublicOrdersTest(t: GlobalTestState) { const r = await httpResp.json(); console.log(r); t.assertDeepEqual(httpResp.status, 200); + const respFulfillmentUrl = r.fulfillment_url; + t.assertDeepEqual(respFulfillmentUrl, "https://example.com/article42"); + } + + // paid, access with correct claim token, HTML + { + const url = new URL(`orders/${orderId}`, merchantBaseUrl); + url.searchParams.set("token", claimToken); + const httpResp = await httpLib.get(url.href, { + headers: { Accept: "text/html" }, + }); + t.assertDeepEqual(httpResp.status, 302); + const location = httpResp.headers.get("Location"); + console.log("location header:", location); + t.assertDeepEqual(location, "https://example.com/article42"); } const confirmPayRes2 = await wallet.client.call(