taler-typescript-core

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

commit 9c3c488efbb606ae210e529c0dc1388afc695915
parent 3a3e5a9cac36ab37204a0468f1a42df0f9b4a248
Author: Florian Dold <dold@taler.net>
Date:   Sun,  6 Sep 2026 12:41:06 +0200

harness: exercise current PWA key-change withdrawal gates

Check legacy funds in the balance list and exclude them from peer
payments. Serve a new terms version after replacing the exchange keys
and recognize the current balance page after cancelling withdrawal.

Diffstat:
Mpackages/taler-harness/src/integrationtests/test-wallet-web-ui-pwa-withdrawal.ts | 36++++++++++++++++++++++++++----------
1 file changed, 26 insertions(+), 10 deletions(-)

diff --git a/packages/taler-harness/src/integrationtests/test-wallet-web-ui-pwa-withdrawal.ts b/packages/taler-harness/src/integrationtests/test-wallet-web-ui-pwa-withdrawal.ts @@ -1000,8 +1000,12 @@ async function runPwaWithdrawalTest( replacementExchange.addCoinConfigList( defaultCoinConfig.map((coin) => coin("TESTKUDOS")), ); + fs.writeFileSync( + path.join(englishTermsDirectory, "v2.txt"), + "Updated exchange terms after the browser test key change.\n", + ); replacementExchange.changeConfig((config) => { - config.setString("exchange", "terms_etag", "v1"); + config.setString("exchange", "terms_etag", "v2"); config.setString("exchange", "terms_dir", termsDirectory); }); await replacementExchange.start(); @@ -1023,17 +1027,27 @@ async function runPwaWithdrawalTest( .getByText("Exchange update started.") .waitFor({ state: "detached" }); + // Superseded coins remain visible, but cannot fund a new payment. + await page.goto(`${pwaUrl}#/`); + await page + .getByRole("button", { name: "Show all balances" }) + .click(); + await page + .getByRole("dialog", { name: "Balances" }) + .getByLabel( + /Legacy balance TESTKUDOS:.*unavailable for normal use/, + ) + .waitFor(); await page.goto(`${pwaUrl}#/peer/send?currency=TESTKUDOS`); await page.getByRole("heading", { name: "Send money" }).waitFor(); - const legacyScope = page + const scopes = page .getByLabel("Currency and payment scope") - .locator("option") - .filter({ hasText: "legacy keys" }); - await legacyScope.waitFor({ state: "attached" }); - if ( - !((await legacyScope.textContent()) ?? "").includes("TESTKUDOS") - ) { - throw Error("legacy-key scope lost its currency label"); + .locator("option"); + await scopes.first().waitFor({ state: "attached" }); + if (await scopes.filter({ hasText: "legacy keys" }).count()) { + throw Error( + "legacy-key coins were offered for a new peer payment", + ); } if (!browserKeyChangeWithdrawalUri) { @@ -1129,7 +1143,9 @@ async function runPwaWithdrawalTest( ); } await page.getByRole("button", { name: "Cancel" }).click(); - await page.getByRole("heading", { name: "Balances" }).waitFor(); + await page + .getByRole("button", { name: "Show all balances" }) + .waitFor(); await page.goto(`${pwaUrl}#/enter`); await page