TASK22229: P2-S2 batch 2 migrate portal/representation relay GET endpoints

This commit is contained in:
2026-03-24 07:45:59 +00:00
parent 6edbc431f8
commit fdf95dd0b1
7 changed files with 146 additions and 166 deletions
@@ -1555,6 +1555,7 @@ test("getmycases returns LOGGED_IN_USER_ID_REQUIRED when loggedInUserId missing"
const mod = loadModule("pages/api/endpoint/getmycases_api.js", {
respondError: respondErrorMock,
respondSuccess: respondSuccessMock,
relayGet: async () => ({}),
getToken: async () => ({ access_token: "token" }),
hashAPIPath: () => "&hash=expected",
azureHeaders: () => ({}),
@@ -1577,6 +1578,8 @@ test("getmycases catch path returns MY_CASES_FETCH_FAILED", async () => {
const mod = loadModule("pages/api/endpoint/getmycases_api.js", {
respondError: respondErrorMock,
respondSuccess: respondSuccessMock,
relayGet: async ({ res, errorResponse }) =>
respondErrorMock(res, errorResponse),
getToken: async () => ({ access_token: "token" }),
hashAPIPath: () => "&hash=expected",
azureHeaders: () => ({}),
@@ -1600,6 +1603,7 @@ test("getmyrepresentations returns LOGGED_IN_USER_ID_REQUIRED when loggedInUserI
const mod = loadModule("pages/api/endpoint/getmyrepresentations_api.js", {
respondError: respondErrorMock,
respondSuccess: respondSuccessMock,
relayGet: async () => ({}),
getToken: async () => ({ access_token: "token" }),
hashAPIPath: () => "&hash=expected",
azureHeaders: () => ({}),
@@ -1622,6 +1626,8 @@ test("getmyrepresentations catch path returns MY_REPRESENTATIONS_FETCH_FAILED",
const mod = loadModule("pages/api/endpoint/getmyrepresentations_api.js", {
respondError: respondErrorMock,
respondSuccess: respondSuccessMock,
relayGet: async ({ res, errorResponse }) =>
respondErrorMock(res, errorResponse),
getToken: async () => ({ access_token: "token" }),
hashAPIPath: () => "&hash=expected",
azureHeaders: () => ({}),
@@ -1648,6 +1654,7 @@ test("getwatchedcases returns LOGGED_IN_USER_ID_REQUIRED when loggedInUserId mis
const mod = loadModule("pages/api/endpoint/getwatchedcases_api.js", {
respondError: respondErrorMock,
respondSuccess: respondSuccessMock,
relayGet: async () => ({}),
getToken: async () => ({ access_token: "token" }),
hashAPIPath: () => "&hash=expected",
azureHeaders: () => ({}),
@@ -1670,6 +1677,8 @@ test("getwatchedcases catch path returns WATCHED_CASES_FETCH_FAILED", async () =
const mod = loadModule("pages/api/endpoint/getwatchedcases_api.js", {
respondError: respondErrorMock,
respondSuccess: respondSuccessMock,
relayGet: async ({ res, errorResponse }) =>
respondErrorMock(res, errorResponse),
getToken: async () => ({ access_token: "token" }),
hashAPIPath: () => "&hash=expected",
azureHeaders: () => ({}),
@@ -1696,6 +1705,7 @@ test("getawaitingsubmission returns LOGGED_IN_USER_ID_REQUIRED when loggedInUser
const mod = loadModule("pages/api/endpoint/getawaitingsubmission_api.js", {
respondError: respondErrorMock,
respondSuccess: respondSuccessMock,
relayGet: async () => ({}),
getToken: async () => ({ access_token: "token" }),
hashAPIPath: () => "&hash=expected",
azureHeaders: () => ({}),
@@ -1718,6 +1728,8 @@ test("getawaitingsubmission catch path returns AWAITING_SUBMISSION_FETCH_FAILED"
const mod = loadModule("pages/api/endpoint/getawaitingsubmission_api.js", {
respondError: respondErrorMock,
respondSuccess: respondSuccessMock,
relayGet: async ({ res, errorResponse }) =>
respondErrorMock(res, errorResponse),
getToken: async () => ({ access_token: "token" }),
hashAPIPath: () => "&hash=expected",
azureHeaders: () => ({}),
@@ -3327,6 +3339,7 @@ test("getrepresentations returns INCIDENT_ID_REQUIRED when incidentID missing",
const mod = loadModule("pages/api/endpoint/getrepresentations_api.js", {
respondError: respondErrorMock,
respondSuccess: respondSuccessMock,
relayGet: async () => ({}),
getToken: async () => ({ access_token: "token" }),
hashAPIPath: () => "&hash=expected",
azureHeaders: () => ({}),
@@ -3346,6 +3359,8 @@ test("getrepresentations catch path returns REPRESENTATIONS_FETCH_FAILED", async
const mod = loadModule("pages/api/endpoint/getrepresentations_api.js", {
respondError: respondErrorMock,
respondSuccess: respondSuccessMock,
relayGet: async ({ res, errorResponse }) =>
respondErrorMock(res, errorResponse),
getToken: async () => ({ access_token: "token" }),
hashAPIPath: () => "&hash=expected",
azureHeaders: () => ({}),