aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-harness/src/integrationtests
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2024-04-02 18:19:11 +0200
committerFlorian Dold <florian@dold.me>2024-04-02 18:40:02 +0200
commit651db75296bfe7c35dc7d29e39f25e6dacb72930 (patch)
treee508ebc04f93e652d6fbbfa4b0193878247ac413 /packages/taler-harness/src/integrationtests
parentb4185a6ef452fba47e481264af06e67524391584 (diff)
downloadwallet-core-651db75296bfe7c35dc7d29e39f25e6dacb72930.tar.xz
wallet-core: refresh cleanup, preparations for #8568
Diffstat (limited to 'packages/taler-harness/src/integrationtests')
-rw-r--r--packages/taler-harness/src/integrationtests/test-wallet-refresh-blocked.ts66
-rw-r--r--packages/taler-harness/src/integrationtests/testrunner.ts2
2 files changed, 68 insertions, 0 deletions
diff --git a/packages/taler-harness/src/integrationtests/test-wallet-refresh-blocked.ts b/packages/taler-harness/src/integrationtests/test-wallet-refresh-blocked.ts
new file mode 100644
index 000000000..806802612
--- /dev/null
+++ b/packages/taler-harness/src/integrationtests/test-wallet-refresh-blocked.ts
@@ -0,0 +1,66 @@
+/*
+ This file is part of GNU Taler
+ (C) 2020 Taler Systems S.A.
+
+ GNU Taler is free software; you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+ */
+
+/**
+ * Imports.
+ */
+import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
+import { GlobalTestState } from "../harness/harness.js";
+import {
+ createSimpleTestkudosEnvironmentV2,
+ createWalletDaemonWithClient,
+ withdrawViaBankV2,
+} from "../harness/helpers.js";
+
+/**
+ * Run test for refreshe after a payment.
+ */
+export async function runWalletRefreshBlockedTest(t: GlobalTestState) {
+ // Set up test environment
+
+ const { walletClient, bank, exchange, merchant } =
+ await createSimpleTestkudosEnvironmentV2(t);
+
+ // Withdraw digital cash into the wallet.
+
+ const { walletClient: w1 } = await createWalletDaemonWithClient(t, {
+ name: "w1",
+ config: {
+ testing: {
+ devModeActive: true,
+ },
+ },
+ });
+
+ await withdrawViaBankV2(t, {
+ walletClient: w1,
+ bank,
+ exchange,
+ amount: "TESTKUDOS:20",
+ });
+
+ await w1.call(WalletApiOperation.TestingWaitTransactionsFinal, {});
+
+ // Prevent the wallet from doing refreshes by injecting a 5xx
+ // status for all refresh requests.
+ await w1.call(WalletApiOperation.ApplyDevExperiment, {
+ devExperimentUri: "taler://dev-experiment/start-block-refresh",
+ });
+
+ // FIXME: Now force a refresh, check balance
+}
+
+runWalletRefreshBlockedTest.suites = ["wallet"];
diff --git a/packages/taler-harness/src/integrationtests/testrunner.ts b/packages/taler-harness/src/integrationtests/testrunner.ts
index 380251b76..2bca91e45 100644
--- a/packages/taler-harness/src/integrationtests/testrunner.ts
+++ b/packages/taler-harness/src/integrationtests/testrunner.ts
@@ -101,6 +101,7 @@ import { runWalletGenDbTest } from "./test-wallet-gendb.js";
import { runWalletInsufficientBalanceTest } from "./test-wallet-insufficient-balance.js";
import { runWalletNotificationsTest } from "./test-wallet-notifications.js";
import { runWalletObservabilityTest } from "./test-wallet-observability.js";
+import { runWalletRefreshBlockedTest } from "./test-wallet-refresh-blocked.js";
import { runWalletRefreshTest } from "./test-wallet-refresh.js";
import { runWalletWirefeesTest } from "./test-wallet-wirefees.js";
import { runWallettestingTest } from "./test-wallettesting.js";
@@ -212,6 +213,7 @@ const allTests: TestMainFunction[] = [
runWalletWirefeesTest,
runDenomLostTest,
runWalletDenomExpireTest,
+ runWalletRefreshBlockedTest,
];
export interface TestRunSpec {