diff options
Diffstat (limited to 'packages/merchant-backoffice-ui/src')
-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: {}, |