refactor(api): migrate batch 7 endpoints to relayGet
This commit is contained in:
@@ -1341,6 +1341,7 @@ test("getsearchdocumentdetails returns INCIDENT_ID_REQUIRED when incidentid miss
|
||||
{
|
||||
respondError: respondErrorMock,
|
||||
respondSuccess: respondSuccessMock,
|
||||
relayGet: async () => ({}),
|
||||
getToken: async () => ({ access_token: "token" }),
|
||||
hashAPIPath: () => "&hash=expected",
|
||||
azureHeadersPaged: () => ({}),
|
||||
@@ -1368,6 +1369,8 @@ test("getsearchdocumentdetails catch path returns SEARCH_DOCUMENT_DETAILS_FETCH_
|
||||
{
|
||||
respondError: respondErrorMock,
|
||||
respondSuccess: respondSuccessMock,
|
||||
relayGet: async ({ res, errorResponse }) =>
|
||||
respondErrorMock(res, errorResponse),
|
||||
getToken: async () => ({ access_token: "token" }),
|
||||
hashAPIPath: () => "&hash=expected",
|
||||
azureHeadersPaged: () => ({}),
|
||||
@@ -1402,6 +1405,7 @@ test("getsearchdocumentdetailspaged returns INCIDENT_ID_REQUIRED when incidentid
|
||||
{
|
||||
respondError: respondErrorMock,
|
||||
respondSuccess: respondSuccessMock,
|
||||
relayGet: async () => ({}),
|
||||
getToken: async () => ({ access_token: "token" }),
|
||||
hashAPIPath: () => "&hash=expected",
|
||||
azureHeadersPagedCustom: () => ({}),
|
||||
@@ -1435,6 +1439,8 @@ test("getsearchdocumentdetailspaged catch path returns SEARCH_DOCUMENT_DETAILS_P
|
||||
{
|
||||
respondError: respondErrorMock,
|
||||
respondSuccess: respondSuccessMock,
|
||||
relayGet: async ({ res, errorResponse }) =>
|
||||
respondErrorMock(res, errorResponse),
|
||||
getToken: async () => ({ access_token: "token" }),
|
||||
hashAPIPath: () => "&hash=expected",
|
||||
azureHeadersPagedCustom: () => ({}),
|
||||
@@ -1474,6 +1480,7 @@ test("getsearchdocumentTypes returns INCIDENT_ID_REQUIRED when incidentid missin
|
||||
const mod = loadModule("pages/api/endpoint/getsearchdocumentTypes_api.js", {
|
||||
respondError: respondErrorMock,
|
||||
respondSuccess: respondSuccessMock,
|
||||
relayGet: async () => ({}),
|
||||
getToken: async () => ({ access_token: "token" }),
|
||||
hashAPIPath: () => "&hash=expected",
|
||||
azureHeaders: () => ({}),
|
||||
@@ -1493,6 +1500,8 @@ test("getsearchdocumentTypes catch path returns SEARCH_DOCUMENT_TYPES_FETCH_FAIL
|
||||
const mod = loadModule("pages/api/endpoint/getsearchdocumentTypes_api.js", {
|
||||
respondError: respondErrorMock,
|
||||
respondSuccess: respondSuccessMock,
|
||||
relayGet: async ({ res, errorResponse }) =>
|
||||
respondErrorMock(res, errorResponse),
|
||||
getToken: async () => ({ access_token: "token" }),
|
||||
hashAPIPath: () => "&hash=expected",
|
||||
azureHeaders: () => ({}),
|
||||
@@ -1519,6 +1528,19 @@ test("getsearchdocumentTypes success returns grouped data payload contract", asy
|
||||
const mod = loadModule("pages/api/endpoint/getsearchdocumentTypes_api.js", {
|
||||
respondError: respondErrorMock,
|
||||
respondSuccess: respondSuccessMock,
|
||||
relayGet: async ({ res }) =>
|
||||
respondSuccessMock(res, [
|
||||
{
|
||||
pinswg_isharedocumentlocations: 1,
|
||||
pinswg_isharedocumentlocationsLabel: "Plans",
|
||||
count: 2
|
||||
},
|
||||
{
|
||||
pinswg_isharedocumentlocations: 2,
|
||||
pinswg_isharedocumentlocationsLabel: "Letters",
|
||||
count: 1
|
||||
}
|
||||
]),
|
||||
getToken: async () => ({ access_token: "token" }),
|
||||
hashAPIPath: () => "&hash=expected",
|
||||
azureHeaders: () => ({}),
|
||||
@@ -2334,6 +2356,7 @@ test("getportalmoduledetailsproxy returns APPEAL_TYPE_REQUIRED when appealType m
|
||||
{
|
||||
respondError: respondErrorMock,
|
||||
respondSuccess: respondSuccessMock,
|
||||
relayGet: async () => ({}),
|
||||
getToken: async () => ({ access_token: "token" }),
|
||||
getSelectQuery: () => "&$select=pinswg_name",
|
||||
hashAPIPath: () => "&hash=expected",
|
||||
@@ -2357,6 +2380,8 @@ test("getportalmoduledetailsproxy catch path returns PORTAL_MODULE_DETAILS_PROXY
|
||||
{
|
||||
respondError: respondErrorMock,
|
||||
respondSuccess: respondSuccessMock,
|
||||
relayGet: async ({ res, errorResponse }) =>
|
||||
respondErrorMock(res, errorResponse),
|
||||
getToken: async () => ({ access_token: "token" }),
|
||||
getSelectQuery: () => "&$select=pinswg_name",
|
||||
hashAPIPath: () => "&hash=expected",
|
||||
@@ -3468,6 +3493,7 @@ test("getappealpdfdocuments returns INCIDENT_ID_REQUIRED when incidentid missing
|
||||
const mod = loadModule("pages/api/endpoint/getappealpdfdocuments_api.js", {
|
||||
respondError: respondErrorMock,
|
||||
respondSuccess: respondSuccessMock,
|
||||
relayGet: async () => ({}),
|
||||
getToken: async () => ({ access_token: "token" }),
|
||||
hashAPIPath: () => "&hash=expected",
|
||||
azureHeaders: () => ({}),
|
||||
@@ -3487,6 +3513,8 @@ test("getappealpdfdocuments catch path returns APPEAL_PDF_DOCUMENTS_FETCH_FAILED
|
||||
const mod = loadModule("pages/api/endpoint/getappealpdfdocuments_api.js", {
|
||||
respondError: respondErrorMock,
|
||||
respondSuccess: respondSuccessMock,
|
||||
relayGet: async ({ res, errorResponse }) =>
|
||||
respondErrorMock(res, errorResponse),
|
||||
getToken: async () => ({ access_token: "token" }),
|
||||
hashAPIPath: () => "&hash=expected",
|
||||
azureHeaders: () => ({}),
|
||||
|
||||
Reference in New Issue
Block a user