Merge commit '3685f8cf' into HEAD
This commit is contained in:
commit
c747ae6036
@ -53,16 +53,16 @@
|
||||
"yup": "^0.32.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.13.16",
|
||||
"@babel/plugin-transform-react-jsx-source": "^7.12.13",
|
||||
"@babel/core": "7.18.9",
|
||||
"@babel/plugin-transform-react-jsx-source": "7.18.6",
|
||||
"@creativebulma/bulma-tooltip": "^1.2.0",
|
||||
"@gnu-taler/pogen": "^0.0.5",
|
||||
"@linaria/babel-preset": "^3.0.0-beta.4",
|
||||
"@linaria/core": "^3.0.0-beta.4",
|
||||
"@linaria/react": "^3.0.0-beta.7",
|
||||
"@linaria/rollup": "^3.0.0-beta.7",
|
||||
"@linaria/shaker": "^3.0.0-beta.7",
|
||||
"@linaria/webpack-loader": "^3.0.0-beta.7",
|
||||
"@linaria/babel-preset": "3.0.0-beta.22",
|
||||
"@linaria/core": "3.0.0-beta.22",
|
||||
"@linaria/react": "3.0.0-beta.22",
|
||||
"@linaria/rollup": "3.0.0-beta.22",
|
||||
"@linaria/shaker": "3.0.0-beta.22",
|
||||
"@linaria/webpack-loader": "3.0.0-beta.22",
|
||||
"@rollup/plugin-alias": "^3.1.5",
|
||||
"@rollup/plugin-babel": "^5.3.0",
|
||||
"@rollup/plugin-commonjs": "^20.0.0",
|
||||
|
@ -55,8 +55,8 @@
|
||||
"yup": "^0.32.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.13.16",
|
||||
"@babel/plugin-transform-react-jsx-source": "^7.12.13",
|
||||
"@babel/core": "7.18.9",
|
||||
"@babel/plugin-transform-react-jsx-source": "7.18.6",
|
||||
"@creativebulma/bulma-tooltip": "^1.2.0",
|
||||
"@gnu-taler/pogen": "^0.0.5",
|
||||
"@storybook/addon-a11y": "^6.2.9",
|
||||
|
@ -44,16 +44,16 @@
|
||||
}
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "7.13.16",
|
||||
"@babel/plugin-transform-modules-commonjs": "^7.18.2",
|
||||
"@babel/plugin-transform-react-jsx-source": "^7.12.13",
|
||||
"@babel/preset-typescript": "^7.13.0",
|
||||
"@babel/runtime": "^7.17.8",
|
||||
"@babel/core": "7.18.9",
|
||||
"@babel/runtime": "7.18.9",
|
||||
"@babel/plugin-transform-modules-commonjs": "7.18.6",
|
||||
"@babel/plugin-transform-react-jsx-source": "7.18.6",
|
||||
"@babel/preset-typescript": "7.18.6",
|
||||
"@gnu-taler/pogen": "workspace:*",
|
||||
"@linaria/babel-preset": "3.0.0-beta.4",
|
||||
"@linaria/core": "3.0.0-beta.4",
|
||||
"@linaria/react": "3.0.0-beta.4",
|
||||
"@linaria/webpack-loader": "3.0.0-beta.4",
|
||||
"@linaria/babel-preset": "3.0.0-beta.22",
|
||||
"@linaria/core": "3.0.0-beta.22",
|
||||
"@linaria/react": "3.0.0-beta.22",
|
||||
"@linaria/webpack-loader": "3.0.0-beta.22",
|
||||
"@testing-library/preact": "^2.0.1",
|
||||
"@testing-library/preact-hooks": "^1.1.0",
|
||||
"@types/chai": "^4.3.0",
|
||||
|
@ -81,9 +81,9 @@ export function Modal({
|
||||
|
||||
return (
|
||||
<Portal
|
||||
ref={handlePortalRef}
|
||||
container={container}
|
||||
// disablePortal={disablePortal}
|
||||
// ref={mountNodeRef}
|
||||
// container={container}
|
||||
// disablePortal={disablePortal}
|
||||
>
|
||||
<div
|
||||
class={[_class, baseStyle].join(" ")}
|
||||
|
@ -92,7 +92,7 @@ export const Portal = forwardRef(function Portal(
|
||||
) : (
|
||||
<Fragment />
|
||||
);
|
||||
});
|
||||
} as any);
|
||||
|
||||
function getContainer(container: any): any {
|
||||
return typeof container === "function" ? container() : container;
|
||||
|
@ -26,8 +26,7 @@ function getJsonIfOk(r: Response): Promise<any> {
|
||||
}
|
||||
|
||||
throw new Error(
|
||||
`Try another server: (${r.status}) ${
|
||||
r.statusText || "internal server error"
|
||||
`Try another server: (${r.status}) ${r.statusText || "internal server error"
|
||||
}`,
|
||||
);
|
||||
}
|
||||
@ -100,7 +99,7 @@ export function compose<SType extends { status: string }, PType>(
|
||||
const viewComponent = viewMap[statusName] as unknown as StateFunc<SType>;
|
||||
return createElement(viewComponent, state);
|
||||
}
|
||||
TheComponent.name = `${name}`;
|
||||
// TheComponent.name = `${name}`;
|
||||
|
||||
return TheComponent;
|
||||
}
|
||||
|
@ -239,44 +239,81 @@ describe("DepositPage states", () => {
|
||||
expect(r.currency).eq(currency);
|
||||
expect(r.account.value).eq(accountSelected);
|
||||
expect(r.amount.value).eq("0");
|
||||
expect(r.depositHandler.onClick).undefined;
|
||||
expect(r.totalFee).deep.eq(Amounts.parseOrThrow(`${currency}:0`));
|
||||
|
||||
r.amount.onInput("10");
|
||||
}
|
||||
|
||||
expect(await waitForStateUpdate()).true;
|
||||
|
||||
{
|
||||
const r = pullLastResultOrThrow();
|
||||
if (r.status !== "ready") expect.fail();
|
||||
expect(r.cancelHandler.onClick).not.undefined;
|
||||
expect(r.currency).eq(currency);
|
||||
expect(r.account.value).eq(accountSelected);
|
||||
expect(r.amount.value).eq("10");
|
||||
expect(r.totalFee).deep.eq(Amounts.parseOrThrow(`${currency}:0`));
|
||||
expect(r.depositHandler.onClick).undefined;
|
||||
|
||||
r.amount.onInput("3");
|
||||
}
|
||||
|
||||
expect(await waitForStateUpdate()).true;
|
||||
|
||||
{
|
||||
const r = pullLastResultOrThrow();
|
||||
if (r.status !== "ready") expect.fail();
|
||||
expect(r.cancelHandler.onClick).not.undefined;
|
||||
expect(r.currency).eq(currency);
|
||||
expect(r.account.value).eq(accountSelected);
|
||||
expect(r.amount.value).eq("3");
|
||||
expect(r.totalFee).deep.eq(Amounts.parseOrThrow(`${currency}:0`));
|
||||
expect(r.depositHandler.onClick).not.undefined;
|
||||
}
|
||||
|
||||
await assertNoPendingUpdate();
|
||||
expect(handler.getCallingQueueState()).eq("empty")
|
||||
});
|
||||
|
||||
// it("should calculate the fee upon entering amount ", async () => {
|
||||
// const { pullLastResultOrThrow, waitForStateUpdate, assertNoPendingUpdate } =
|
||||
// mountHook(() =>
|
||||
// useComponentState(
|
||||
// { currency, onCancel: nullFunction, onSuccess: nullFunction },
|
||||
// {
|
||||
// getBalance: async () =>
|
||||
// ({
|
||||
// balances: [{ available: `${currency}:1` }],
|
||||
// } as Partial<BalancesResponse>),
|
||||
// listKnownBankAccounts: async () => ({ accounts: [ibanPayto] }),
|
||||
// getFeeForDeposit: withSomeFee,
|
||||
// } as Partial<typeof wxApi> as any,
|
||||
// ),
|
||||
// );
|
||||
|
||||
// {
|
||||
// const { status } = getLastResultOrThrow();
|
||||
// expect(status).equal("loading");
|
||||
// }
|
||||
|
||||
// await waitNextUpdate();
|
||||
|
||||
// {
|
||||
// const r = getLastResultOrThrow();
|
||||
// if (r.status !== "ready") expect.fail();
|
||||
// expect(r.cancelHandler.onClick).not.undefined;
|
||||
// expect(r.currency).eq(currency);
|
||||
// expect(r.account.value).eq(accountSelected);
|
||||
// expect(r.amount.value).eq("0");
|
||||
// expect(r.depositHandler.onClick).undefined;
|
||||
// expect(r.totalFee).deep.eq(Amounts.parseOrThrow(`${currency}:0`));
|
||||
|
||||
// r.amount.onInput("10");
|
||||
// }
|
||||
|
||||
// expect(await waitForStateUpdate()).true;
|
||||
|
||||
// {
|
||||
// const r = pullLastResultOrThrow();
|
||||
// if (r.status !== "ready") expect.fail();
|
||||
// expect(r.cancelHandler.onClick).not.undefined;
|
||||
// expect(r.currency).eq(currency);
|
||||
// expect(r.account.value).eq(accountSelected);
|
||||
// expect(r.amount.value).eq("10");
|
||||
// expect(r.totalFee).deep.eq(Amounts.parseOrThrow(`${currency}:0`));
|
||||
// expect(r.depositHandler.onClick).undefined;
|
||||
|
||||
// r.amount.onInput("3");
|
||||
// }
|
||||
|
||||
// expect(await waitForStateUpdate()).true;
|
||||
|
||||
// {
|
||||
// const r = pullLastResultOrThrow();
|
||||
// if (r.status !== "ready") expect.fail();
|
||||
// expect(r.cancelHandler.onClick).not.undefined;
|
||||
// expect(r.currency).eq(currency);
|
||||
// expect(r.account.value).eq(accountSelected);
|
||||
// expect(r.amount.value).eq("3");
|
||||
// expect(r.totalFee).deep.eq(Amounts.parseOrThrow(`${currency}:0`));
|
||||
// expect(r.depositHandler.onClick).not.undefined;
|
||||
// }
|
||||
|
||||
// await assertNoPendingUpdate();
|
||||
// expect(handler.getCallingQueueState()).eq("empty")
|
||||
// });
|
||||
|
||||
it("should calculate the fee upon entering amount ", async () => {
|
||||
const { handler, mock } = createWalletApiMock();
|
||||
const props = { currency, onCancel: nullFunction, onSuccess: nullFunction }
|
||||
|
8622
pnpm-lock.yaml
8622
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user