chore(server/test): password protected share

This commit is contained in:
Elian Doran
2025-02-26 20:23:52 +02:00
parent fa60295ab2
commit 7ea3cb71f3
4 changed files with 181 additions and 4 deletions

20
src/share/routes.spec.ts Normal file
View File

@@ -0,0 +1,20 @@
import { beforeAll, describe, it } from "vitest";
import supertest from "supertest";
import type { App } from "supertest/types.js";
import { initializeTranslations } from "../services/i18n.js";
let app: App;
describe("Share API test", () => {
beforeAll(async () => {
initializeTranslations();
app = (await import("../app.js")).default;
});
it("requests password for password-protected share", async () => {
await supertest(app)
.get("/share/YjlPRj2E9fOV")
.expect("WWW-Authenticate", 'Basic realm="User Visible Realm", charset="UTF-8"');
});
});