Fix tests
This commit is contained in:
parent
1ece491472
commit
64cd9cc217
2772
package-lock.json
generated
2772
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -47,7 +47,7 @@
|
|||||||
"nodemon": "^3.0.1",
|
"nodemon": "^3.0.1",
|
||||||
"object-path": "^0.11.8",
|
"object-path": "^0.11.8",
|
||||||
"qs": "^6.12.0",
|
"qs": "^6.12.0",
|
||||||
"sealious": "^0.18.1",
|
"sealious": "^0.18.3",
|
||||||
"stimulus": "^2.0.0",
|
"stimulus": "^2.0.0",
|
||||||
"tempstream": "^0.3.15",
|
"tempstream": "^0.3.15",
|
||||||
"unplugin-auto-import": "^0.17.5",
|
"unplugin-auto-import": "^0.17.5",
|
||||||
|
@ -12,6 +12,7 @@ export default new (class LogoutRedirect extends Mountable {
|
|||||||
|
|
||||||
mount(router: Router, path: string) {
|
mount(router: Router, path: string) {
|
||||||
router.get(path, async (ctx) => {
|
router.get(path, async (ctx) => {
|
||||||
|
console.log("logout.redirect.ts:15");
|
||||||
try {
|
try {
|
||||||
const session_id = ctx.cookies.get("sealious-session");
|
const session_id = ctx.cookies.get("sealious-session");
|
||||||
if (session_id) {
|
if (session_id) {
|
||||||
@ -21,6 +22,9 @@ export default new (class LogoutRedirect extends Mountable {
|
|||||||
);
|
);
|
||||||
ctx.status = 302;
|
ctx.status = 302;
|
||||||
ctx.redirect("/");
|
ctx.redirect("/");
|
||||||
|
} else {
|
||||||
|
ctx.status = 302;
|
||||||
|
ctx.redirect("/");
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error during logout:", error);
|
console.error("Error during logout:", error);
|
||||||
|
@ -23,21 +23,6 @@ describe.concurrent("Logout", () => {
|
|||||||
await context.close();
|
await context.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
it(
|
|
||||||
"doesn't crash",
|
|
||||||
async function () {
|
|
||||||
return withProdApp(async ({ rest_api }) => {
|
|
||||||
await assert.rejects(
|
|
||||||
async () => {
|
|
||||||
await rest_api.get(LogoutURL);
|
|
||||||
},
|
|
||||||
{ name: "Error" }
|
|
||||||
);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
VERY_LONG_TEST_TIMEOUT
|
|
||||||
);
|
|
||||||
|
|
||||||
describe("logout test", () => {
|
describe("logout test", () => {
|
||||||
it(
|
it(
|
||||||
"logout",
|
"logout",
|
||||||
|
@ -15,7 +15,12 @@ describe("Todo webhint", () => {
|
|||||||
async () => {
|
async () => {
|
||||||
await rest_api.get(TodoURL);
|
await rest_api.get(TodoURL);
|
||||||
},
|
},
|
||||||
{ name: "Error" }
|
{
|
||||||
|
response: {
|
||||||
|
data: "no access",
|
||||||
|
status: 403,
|
||||||
|
},
|
||||||
|
}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user