TASK22229: pilot shared relay forwarding utility

This commit is contained in:
2026-03-24 06:40:32 +00:00
parent dea127912f
commit 312f7415f5
7 changed files with 162 additions and 133 deletions
@@ -533,6 +533,7 @@ test("getwatchedcasesproxy returns LOGGED_IN_USER_ID_REQUIRED when loggedInUserI
const mod = loadModule("pages/api/endpoint/getwatchedcasesproxy_api.js", {
respondError: respondErrorMock,
respondSuccess: respondSuccessMock,
relayGet: async () => ({}),
getToken: async () => ({ access_token: "token" }),
hashAPIPath: () => "&hash=expected",
azureHeaders: () => ({}),
@@ -555,6 +556,8 @@ test("getwatchedcasesproxy catch path returns WATCHED_CASES_PROXY_FETCH_FAILED",
const mod = loadModule("pages/api/endpoint/getwatchedcasesproxy_api.js", {
respondError: respondErrorMock,
respondSuccess: respondSuccessMock,
relayGet: async ({ res, errorResponse }) =>
respondErrorMock(res, errorResponse),
getToken: async () => ({ access_token: "token" }),
hashAPIPath: () => "&hash=expected",
azureHeaders: () => ({}),
@@ -583,6 +586,7 @@ test("getmyrepresentationsproxy returns LOGGED_IN_USER_ID_REQUIRED when loggedIn
{
respondError: respondErrorMock,
respondSuccess: respondSuccessMock,
relayGet: async () => ({}),
getToken: async () => ({ access_token: "token" }),
hashAPIPath: () => "&hash=expected",
azureHeaders: () => ({}),
@@ -608,6 +612,8 @@ test("getmyrepresentationsproxy catch path returns MY_REPRESENTATIONS_PROXY_FETC
{
respondError: respondErrorMock,
respondSuccess: respondSuccessMock,
relayGet: async ({ res, errorResponse }) =>
respondErrorMock(res, errorResponse),
getToken: async () => ({ access_token: "token" }),
hashAPIPath: () => "&hash=expected",
azureHeaders: () => ({}),
@@ -637,6 +643,7 @@ test("getrepresentationsproxy returns INCIDENT_ID_REQUIRED when incidentID missi
{
respondError: respondErrorMock,
respondSuccess: respondSuccessMock,
relayGet: async () => ({}),
getToken: async () => ({ access_token: "token" }),
hashAPIPath: () => "&hash=expected",
azureHeaders: () => ({}),
@@ -659,6 +666,8 @@ test("getrepresentationsproxy catch path returns REPRESENTATIONS_PROXY_FETCH_FAI
{
respondError: respondErrorMock,
respondSuccess: respondSuccessMock,
relayGet: async ({ res, errorResponse }) =>
respondErrorMock(res, errorResponse),
getToken: async () => ({ access_token: "token" }),
hashAPIPath: () => "&hash=expected",
azureHeaders: () => ({}),
@@ -688,6 +697,7 @@ test("getawaitingsubmissionproxy returns LOGGED_IN_USER_ID_REQUIRED when loggedI
{
respondError: respondErrorMock,
respondSuccess: respondSuccessMock,
relayGet: async () => ({}),
getToken: async () => ({ access_token: "token" }),
hashAPIPath: () => "&hash=expected",
azureHeaders: () => ({}),
@@ -713,6 +723,8 @@ test("getawaitingsubmissionproxy catch path returns AWAITING_SUBMISSION_PROXY_FE
{
respondError: respondErrorMock,
respondSuccess: respondSuccessMock,
relayGet: async ({ res, errorResponse }) =>
respondErrorMock(res, errorResponse),
getToken: async () => ({ access_token: "token" }),
hashAPIPath: () => "&hash=expected",
azureHeaders: () => ({}),