refactor(api): migrate batch 11 advancedsearchpaged to relayGet
This commit is contained in:
@@ -1101,11 +1101,8 @@ test("getadvancedsearchpaged returns SEARCH_STRING_REQUIRED when searchstring mi
|
||||
const mod = loadModule("pages/api/endpoint/getadvancedsearchpaged_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 }
|
||||
});
|
||||
|
||||
@@ -1127,11 +1124,8 @@ test("getadvancedsearchpaged returns ORDER_BY_REQUIRED when orderby missing", as
|
||||
const mod = loadModule("pages/api/endpoint/getadvancedsearchpaged_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 }
|
||||
});
|
||||
|
||||
@@ -1153,15 +1147,9 @@ test("getadvancedsearchpaged catch path returns ADVANCED_SEARCH_PAGED_FETCH_FAIL
|
||||
const mod = loadModule("pages/api/endpoint/getadvancedsearchpaged_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 }
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user