diff options
author | Sebastian <sebasjm@gmail.com> | 2023-04-21 07:35:03 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2023-04-21 07:35:03 -0300 |
commit | c5c00e4da73e2eefd9f75f21b8321f0ba7ff2188 (patch) | |
tree | 67ece06fae2cfa7683c50e5cb15dbcf2f7001fba /packages/merchant-backoffice-ui/src/hooks | |
parent | b9c24772f52387c123f3529f8db0754b6f500d74 (diff) | |
download | wallet-core-c5c00e4da73e2eefd9f75f21b8321f0ba7ff2188.tar.xz |
moving libs to web utils, apply new mock api to backoffice
Diffstat (limited to 'packages/merchant-backoffice-ui/src/hooks')
-rw-r--r-- | packages/merchant-backoffice-ui/src/hooks/testing.tsx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/packages/merchant-backoffice-ui/src/hooks/testing.tsx b/packages/merchant-backoffice-ui/src/hooks/testing.tsx index 67831f8a4..132c5f166 100644 --- a/packages/merchant-backoffice-ui/src/hooks/testing.tsx +++ b/packages/merchant-backoffice-ui/src/hooks/testing.tsx @@ -71,16 +71,19 @@ export class ApiMockEnvironment extends MockEnvironment { request: options.data, }, ); + const status = mocked.expectedQuery?.query.code ?? 200; + const requestPayload = mocked.expectedQuery?.params?.request; + const responsePayload = mocked.expectedQuery?.params?.response; return { ok: true, - data: (!mocked ? undefined : mocked.payload) as T, + data: responsePayload as T, loading: false, clientError: false, serverError: false, info: { hasToken: !!options.token, - status: !mocked ? 200 : mocked.status, + status, url: _url.href, payload: options.data, options: {}, |