TASK22269: group migrate remaining account/portal signed GET flows
This commit is contained in:
@@ -256,9 +256,13 @@ test("account/getPortalLogin appends hash and returns res.data", async () => {
|
||||
return { data: { hash: "&hash=login123" } };
|
||||
}
|
||||
|
||||
return { data: { value: [{ id: "user-1" }] } };
|
||||
throw new Error("Unexpected get url: " + url);
|
||||
};
|
||||
|
||||
axios.requestHandler = async () => ({
|
||||
data: { value: [{ id: "user-1" }] }
|
||||
});
|
||||
|
||||
const account = loadServiceModule("accountDirectService.js", {
|
||||
axios,
|
||||
BASE_URL: "http://example.local",
|
||||
@@ -274,8 +278,9 @@ test("account/getPortalLogin appends hash and returns res.data", async () => {
|
||||
signCalls[0],
|
||||
"/api/endpoint/gethash_api?path=%2Fapi%2Fendpoint%2Fgetportallogin_api%3FemailAddress%3Dperson%40example.com"
|
||||
);
|
||||
assert.strictEqual(axios.calls[1].config.method, "get");
|
||||
assert.strictEqual(
|
||||
axios.calls[1].url,
|
||||
axios.calls[1].config.url,
|
||||
"http://example.local/api/endpoint/getportallogin_api?emailAddress=person@example.com&hash=login123"
|
||||
);
|
||||
});
|
||||
@@ -290,9 +295,11 @@ test("account/getPortalLogin returns JSON stringified error on failure", async (
|
||||
return { data: { hash: "&hash=err" } };
|
||||
}
|
||||
|
||||
return Promise.reject(error);
|
||||
throw new Error("Unexpected get url: " + url);
|
||||
};
|
||||
|
||||
axios.requestHandler = async () => Promise.reject(error);
|
||||
|
||||
const account = loadServiceModule("accountDirectService.js", {
|
||||
axios,
|
||||
BASE_URL: "",
|
||||
|
||||
Reference in New Issue
Block a user