diff options
author | Sebastian <sebasjm@gmail.com> | 2023-11-09 10:00:24 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2023-11-09 10:00:24 -0300 |
commit | ab9ce29b56f5f8d8bfa16570e56cfe13810cad6a (patch) | |
tree | 8f53be86fca5a80e3939749651ad61c07fa43899 /packages/merchant-backoffice-ui/src/hooks/transfer.test.ts | |
parent | d2f8962fd00f2f9137d50e15b139c76db7ed0c7c (diff) | |
download | wallet-core-ab9ce29b56f5f8d8bfa16570e56cfe13810cad6a.tar.xz |
update test for "limit=0" optimization
Diffstat (limited to 'packages/merchant-backoffice-ui/src/hooks/transfer.test.ts')
-rw-r--r-- | packages/merchant-backoffice-ui/src/hooks/transfer.test.ts | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/packages/merchant-backoffice-ui/src/hooks/transfer.test.ts b/packages/merchant-backoffice-ui/src/hooks/transfer.test.ts index 10cb4226b..a7187af27 100644 --- a/packages/merchant-backoffice-ui/src/hooks/transfer.test.ts +++ b/packages/merchant-backoffice-ui/src/hooks/transfer.test.ts @@ -31,18 +31,9 @@ describe("transfer api interaction with listing", () => { const env = new ApiMockEnvironment(); env.addRequestExpectation(API_LIST_TRANSFERS, { - qparam: { limit: 0 }, - response: { - transfers: [{ wtid: "2" } as MerchantBackend.Transfers.TransferDetails], - }, - }); - // FIXME: is this query really needed? if the hook is rendered without - // position argument then then backend is returning the newest and no need - // to this second query - env.addRequestExpectation(API_LIST_TRANSFERS, { qparam: { limit: -20 }, response: { - transfers: [], + transfers: [{ wtid: "2" } as MerchantBackend.Transfers.TransferDetails], }, }); @@ -84,16 +75,9 @@ describe("transfer api interaction with listing", () => { }); env.addRequestExpectation(API_LIST_TRANSFERS, { - qparam: { limit: 0 }, - response: { - transfers: [{ wtid: "2" } as any, { wtid: "3" } as any], - }, - }); - - env.addRequestExpectation(API_LIST_TRANSFERS, { qparam: { limit: -20 }, response: { - transfers: [], + transfers: [{ wtid: "3" } as any, { wtid: "2" } as any], }, }); @@ -130,16 +114,9 @@ describe("transfer listing pagination", () => { const env = new ApiMockEnvironment(); env.addRequestExpectation(API_LIST_TRANSFERS, { - qparam: { limit: 0, payto_uri: "payto://" }, - response: { - transfers: [{ wtid: "2" } as any], - }, - }); - - env.addRequestExpectation(API_LIST_TRANSFERS, { qparam: { limit: -20, payto_uri: "payto://" }, response: { - transfers: [{ wtid: "1" } as any], + transfers: [{ wtid: "2" }, { wtid: "1" } as any], }, }); |