Fix tests

This commit is contained in:
Kuba Orlik 2024-03-26 13:07:46 +01:00
parent 1ece491472
commit 64cd9cc217
5 changed files with 1157 additions and 1643 deletions

2772
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -47,7 +47,7 @@
"nodemon": "^3.0.1",
"object-path": "^0.11.8",
"qs": "^6.12.0",
"sealious": "^0.18.1",
"sealious": "^0.18.3",
"stimulus": "^2.0.0",
"tempstream": "^0.3.15",
"unplugin-auto-import": "^0.17.5",

View File

@ -12,6 +12,7 @@ export default new (class LogoutRedirect extends Mountable {
mount(router: Router, path: string) {
router.get(path, async (ctx) => {
console.log("logout.redirect.ts:15");
try {
const session_id = ctx.cookies.get("sealious-session");
if (session_id) {
@ -21,6 +22,9 @@ export default new (class LogoutRedirect extends Mountable {
);
ctx.status = 302;
ctx.redirect("/");
} else {
ctx.status = 302;
ctx.redirect("/");
}
} catch (error) {
console.error("Error during logout:", error);

View File

@ -23,21 +23,6 @@ describe.concurrent("Logout", () => {
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", () => {
it(
"logout",

View File

@ -15,7 +15,12 @@ describe("Todo webhint", () => {
async () => {
await rest_api.get(TodoURL);
},
{ name: "Error" }
{
response: {
data: "no access",
status: 403,
},
}
);
});
},