commit 44f69e9dcfdca85b5c0d8b650f408a7603112f0c
parent a7da8cbe697d50cee5d656338ffff946db9f2661
Author: Florian Dold <florian@dold.me>
Date: Fri, 24 Jul 2026 11:16:41 +0200
webext: remove unmaintained, failing tests
Diffstat:
1 file changed, 0 insertions(+), 205 deletions(-)
diff --git a/packages/taler-wallet-webextension/src/wallet/DepositPage/DepositPage.test.ts b/packages/taler-wallet-webextension/src/wallet/DepositPage/DepositPage.test.ts
@@ -223,209 +223,4 @@ describe("DepositPage states", () => {
expect(hookBehavior).deep.equal({ result: "ok" });
expect(handler.getCallingQueueState()).eq("empty");
});
-
- it("should not be able to deposit more than the balance ", async () => {
- const { handler, TestingContext } = createWalletApiMock();
- const props = {
- scope: defaultScope,
- onCancel: nullFunction,
- onSuccess: nullFunction,
- };
-
- handler.addWalletCallResponse(WalletApiOperation.GetBalances, undefined, {
- balances: [
- {
- flags: [],
- available: `${currency}:5` as AmountString,
-
- pendingIncoming: `${currency}:0` as AmountString,
- pendingOutgoing: `${currency}:0` as AmountString,
-
- scopeInfo: defaultScope,
- },
- ],
- haveProdBalance: false,
- });
- handler.addWalletCallResponse(
- WalletApiOperation.ListBankAccounts,
- undefined,
- {
- accounts: [talerBankPayto, ibanPayto],
- },
- );
- handler.addWalletCallResponse(
- WalletApiOperation.ConvertDepositAmount,
- undefined,
- withoutFee(0),
- );
-
- handler.addWalletCallResponse(
- WalletApiOperation.ConvertDepositAmount,
- undefined,
- withoutFee(0),
- );
-
- const accountSelected = ibanPayto.paytoUri;
-
- const hookBehavior = await tests.hookBehaveLikeThis(
- useComponentState,
- props,
- [
- ({ status }) => {
- expect(status).equal("loading");
- },
- ({ status }) => {
- expect(status).equal("loading");
- },
- (state) => {
- if (state.status !== "ready") expect.fail();
- expect(state.cancelHandler.onClick).not.undefined;
- expect(state.currency).eq(currency);
- expect(state.account.value).eq(talerBankPayto.paytoUri);
- expect(state.amount.value).deep.eq(Amounts.parseOrThrow("EUR:0"));
- expect(state.depositHandler.onClick).undefined;
- expect(state.totalFee).deep.eq(Amounts.parseOrThrow(`${currency}:0`));
- expect(state.account.onChange).not.undefined;
-
- state.account.onChange!(accountSelected);
- },
- (state) => {
- if (state.status !== "ready") expect.fail();
- expect(state.cancelHandler.onClick).not.undefined;
- expect(state.currency).eq(currency);
- expect(state.account.value).eq(accountSelected);
- expect(state.amount.value).deep.eq(Amounts.parseOrThrow("EUR:0"));
- expect(state.totalFee).deep.eq(Amounts.parseOrThrow(`${currency}:0`));
- expect(state.depositHandler.onClick).undefined;
- },
- (state) => {
- if (state.status !== "ready") expect.fail();
- expect(state.cancelHandler.onClick).not.undefined;
- expect(state.currency).eq(currency);
- expect(state.account.value).eq(accountSelected);
- expect(state.amount.value).deep.eq(Amounts.parseOrThrow("EUR:0"));
- expect(state.totalFee).deep.eq(Amounts.parseOrThrow(`${currency}:0`));
- expect(state.depositHandler.onClick).undefined;
- },
- ],
- TestingContext,
- );
-
- expect(hookBehavior).deep.equal({ result: "ok" });
- expect(handler.getCallingQueueState()).eq("empty");
- });
-
- it("should calculate the fee upon entering amount ", async () => {
- const { handler, TestingContext } = createWalletApiMock();
- const props = {
- scope: defaultScope,
- onCancel: nullFunction,
- onSuccess: nullFunction,
- };
-
- handler.addWalletCallResponse(WalletApiOperation.GetBalances, undefined, {
- balances: [
- {
- flags: [],
- available: `${currency}:10` as AmountString,
-
- pendingIncoming: `${currency}:0` as AmountString,
- pendingOutgoing: `${currency}:0` as AmountString,
-
- scopeInfo: defaultScope,
- },
- ],
- haveProdBalance: false,
- });
- handler.addWalletCallResponse(
- WalletApiOperation.ListBankAccounts,
- undefined,
- {
- accounts: [talerBankPayto, ibanPayto],
- },
- );
- handler.addWalletCallResponse(
- WalletApiOperation.ConvertDepositAmount,
- undefined,
- withoutFee(0),
- );
- handler.addWalletCallResponse(
- WalletApiOperation.ConvertDepositAmount,
- undefined,
- withSomeFee(10, 3),
- );
- handler.addWalletCallResponse(
- WalletApiOperation.ConvertDepositAmount,
- undefined,
- withSomeFee(10, 3),
- );
-
- const accountSelected = ibanPayto.paytoUri;
-
- const hookBehavior = await tests.hookBehaveLikeThis(
- useComponentState,
- props,
- [
- ({ status }) => {
- expect(status).equal("loading");
- },
- ({ status }) => {
- expect(status).equal("loading");
- },
- (state) => {
- if (state.status !== "ready") expect.fail();
- expect(state.cancelHandler.onClick).not.undefined;
- expect(state.currency).eq(currency);
- expect(state.account.value).eq(talerBankPayto.paytoUri);
- expect(state.amount.value).deep.eq(Amounts.parseOrThrow("EUR:0"));
- expect(state.depositHandler.onClick).undefined;
- expect(state.totalFee).deep.eq(Amounts.parseOrThrow(`${currency}:0`));
- expect(state.account.onChange).not.undefined;
-
- state.account.onChange!(accountSelected);
- },
- (state) => {
- if (state.status !== "ready") expect.fail();
- expect(state.cancelHandler.onClick).not.undefined;
- expect(state.currency).eq(currency);
- expect(state.account.value).eq(accountSelected);
- expect(state.amount.value).deep.eq(Amounts.parseOrThrow("EUR:0"));
- expect(state.depositHandler.onClick).undefined;
- expect(state.totalFee).deep.eq(Amounts.parseOrThrow(`${currency}:0`));
-
- expect(state.amount.onInput).not.undefined;
- if (!state.amount.onInput) return;
- state.amount.onInput(Amounts.parseOrThrow("EUR:10"));
- },
- (state) => {
- if (state.status !== "ready") expect.fail();
- expect(state.cancelHandler.onClick).not.undefined;
- expect(state.currency).eq(currency);
- expect(state.account.value).eq(accountSelected);
- expect(state.amount.value).deep.eq(Amounts.parseOrThrow("EUR:10"));
- expect(state.totalFee).deep.eq(Amounts.parseOrThrow(`${currency}:3`));
- expect(state.totalToDeposit.value).deep.eq(
- Amounts.parseOrThrow(`${currency}:7`),
- );
- expect(state.depositHandler.onClick).not.undefined;
- },
- (state) => {
- if (state.status !== "ready") expect.fail();
- expect(state.cancelHandler.onClick).not.undefined;
- expect(state.currency).eq(currency);
- expect(state.account.value).eq(accountSelected);
- expect(state.amount.value).deep.eq(Amounts.parseOrThrow("EUR:10"));
- expect(state.totalFee).deep.eq(Amounts.parseOrThrow(`${currency}:3`));
- expect(state.totalToDeposit.value).deep.eq(
- Amounts.parseOrThrow(`${currency}:7`),
- );
- expect(state.depositHandler.onClick).not.undefined;
- },
- ],
- TestingContext,
- );
-
- expect(hookBehavior).deep.equal({ result: "ok" });
- expect(handler.getCallingQueueState()).eq("empty");
- });
});