diff options
| author | Florian Dold <florian@dold.me> | 2021-08-13 14:28:54 +0200 | 
|---|---|---|
| committer | Florian Dold <florian@dold.me> | 2021-08-13 14:28:54 +0200 | 
| commit | 9e07bc99639b1ddeb401b463a2a658caeb79f487 (patch) | |
| tree | 539be1188dcb4add2539f57793008997c84ae350 | |
| parent | 2f945b2aebf3378496c8be3ef48a16253dde3358 (diff) | |
merchant spec: more checks
| -rw-r--r-- | packages/taler-wallet-cli/src/integrationtests/test-merchant-spec-public-orders.ts | 17 | 
1 files changed, 16 insertions, 1 deletions
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 index 98528ada4..6e08d7f6e 100644 --- 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(  | 
