refactor(api): migrate batch 9 endpoints to relayGet
This commit is contained in:
@@ -2141,11 +2141,8 @@ test("getbasicdnssearchpaged returns ORDER_BY_REQUIRED when orderby missing", as
|
||||
const mod = loadModule("pages/api/endpoint/getbasicdnssearchpaged_api.js", {
|
||||
respondError: respondErrorMock,
|
||||
respondSuccess: respondSuccessMock,
|
||||
getToken: async () => ({ access_token: "token" }),
|
||||
hashAPIPath: () => "&hash=expected",
|
||||
relayGet: async () => ({}),
|
||||
azureHeadersPagedCustom: () => ({}),
|
||||
axios: { get: async () => ({ data: { value: [] } }) },
|
||||
consoleLogger: () => {},
|
||||
_: { has: () => false }
|
||||
});
|
||||
|
||||
@@ -2161,15 +2158,9 @@ test("getbasicdnssearchpaged catch path returns BASIC_DNS_SEARCH_PAGED_FETCH_FAI
|
||||
const mod = loadModule("pages/api/endpoint/getbasicdnssearchpaged_api.js", {
|
||||
respondError: respondErrorMock,
|
||||
respondSuccess: respondSuccessMock,
|
||||
getToken: async () => ({ access_token: "token" }),
|
||||
hashAPIPath: () => "&hash=expected",
|
||||
relayGet: async ({ res, errorResponse }) =>
|
||||
respondErrorMock(res, errorResponse),
|
||||
azureHeadersPagedCustom: () => ({}),
|
||||
axios: {
|
||||
get: async () => {
|
||||
throw new Error("relay failed");
|
||||
}
|
||||
},
|
||||
consoleLogger: () => {},
|
||||
_: { has: () => false }
|
||||
});
|
||||
|
||||
@@ -2939,11 +2930,8 @@ test("getappealid returns CASE_REFERENCE_REQUIRED when caseReference missing", a
|
||||
const mod = loadModule("pages/api/endpoint/getappealid_api.js", {
|
||||
respondError: respondErrorMock,
|
||||
respondSuccess: respondSuccessMock,
|
||||
getToken: async () => ({ access_token: "token" }),
|
||||
hashAPIPath: () => "&hash=expected",
|
||||
azureHeaders: () => ({}),
|
||||
axios: { get: async () => ({ data: { value: [] } }) },
|
||||
consoleLogger: () => {}
|
||||
relayGet: async () => ({}),
|
||||
azureHeaders: () => ({})
|
||||
});
|
||||
|
||||
const req = {
|
||||
@@ -2966,15 +2954,9 @@ test("getappealid catch path returns APPEAL_ID_FETCH_FAILED", async () => {
|
||||
const mod = loadModule("pages/api/endpoint/getappealid_api.js", {
|
||||
respondError: respondErrorMock,
|
||||
respondSuccess: respondSuccessMock,
|
||||
getToken: async () => ({ access_token: "token" }),
|
||||
hashAPIPath: () => "&hash=expected",
|
||||
azureHeaders: () => ({}),
|
||||
axios: {
|
||||
get: async () => {
|
||||
throw new Error("relay failed");
|
||||
}
|
||||
},
|
||||
consoleLogger: () => {}
|
||||
relayGet: async ({ res, errorResponse }) =>
|
||||
respondErrorMock(res, errorResponse),
|
||||
azureHeaders: () => ({})
|
||||
});
|
||||
|
||||
const req = {
|
||||
@@ -3196,15 +3178,9 @@ test("getdnslist catch path returns DNS_LIST_FETCH_FAILED", async () => {
|
||||
const mod = loadModule("pages/api/endpoint/getdnslist_api.js", {
|
||||
respondError: respondErrorMock,
|
||||
respondSuccess: respondSuccessMock,
|
||||
getToken: async () => ({ access_token: "token" }),
|
||||
hashAPIPath: () => "&hash=expected",
|
||||
relayGet: async ({ res, errorResponse }) =>
|
||||
respondErrorMock(res, errorResponse),
|
||||
azureHeaders: () => ({}),
|
||||
axios: {
|
||||
get: async () => {
|
||||
throw new Error("relay failed");
|
||||
}
|
||||
},
|
||||
consoleLogger: () => {},
|
||||
_: { has: () => false }
|
||||
});
|
||||
|
||||
@@ -3270,11 +3246,8 @@ test("getbasicpartsaveddetails returns APPEAL_TYPE_NAME_REQUIRED when appealType
|
||||
{
|
||||
respondError: respondErrorMock,
|
||||
respondSuccess: respondSuccessMock,
|
||||
getToken: async () => ({ access_token: "token" }),
|
||||
hashAPIPath: () => "&hash=expected",
|
||||
azureHeadersNoOdata: () => ({}),
|
||||
axios: { get: async () => ({ data: { value: [] } }) },
|
||||
consoleLogger: () => {}
|
||||
relayGet: async () => ({}),
|
||||
azureHeadersNoOdata: () => ({})
|
||||
}
|
||||
);
|
||||
|
||||
@@ -3300,15 +3273,9 @@ test("getbasicpartsaveddetails catch path returns BASIC_PART_SAVED_DETAILS_FETCH
|
||||
{
|
||||
respondError: respondErrorMock,
|
||||
respondSuccess: respondSuccessMock,
|
||||
getToken: async () => ({ access_token: "token" }),
|
||||
hashAPIPath: () => "&hash=expected",
|
||||
azureHeadersNoOdata: () => ({}),
|
||||
axios: {
|
||||
get: async () => {
|
||||
throw new Error("relay failed");
|
||||
}
|
||||
},
|
||||
consoleLogger: () => {}
|
||||
relayGet: async ({ res, errorResponse }) =>
|
||||
respondErrorMock(res, errorResponse),
|
||||
azureHeadersNoOdata: () => ({})
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user